Skip to main content
Glama

reindex

Destructive

Rebuild PostgreSQL index, table, or schema storage in place with optional CONCURRENTLY, and preview changes using dry-run before committing. No undo.

Instructions

[WRITE][risk=medium] REINDEX an index/table/schema (rebuild in place, no undo).

Rebuilds physical index storage; there is no inverse. Pass dry_run=True to
preview.

Args:
    target_name: The index/table/schema name to reindex.
    kind: INDEX, TABLE, or SCHEMA (default INDEX).
    concurrently: Rebuild with CONCURRENTLY.
    dry_run: If True, preview without rebuilding.
    target: Target name from config; omit for the default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoINDEX
targetNo
dry_runNo
target_nameYes
concurrentlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true and idempotentHint=false, but the description adds real context beyond them: 'rebuild in place, no undo' and 'there is no inverse,' plus a safe preview path via dry_run. It stops short of describing locking impact or expected duration, which CONCURRENTLY implies but never explains.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Risk/write tags and the destructive caveat are front-loaded, and the args list is compact with no filler. The docs mirror the parameter names closely enough that a few lines are near-redundant, but nothing is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter, 0%-schema-coverage mutation tool with no output schema, the description supplies the essential missing semantics (destructiveness, irreversibility, preview flag, kind values). It leaves gaps on concurrency/locking behavior and post-run effects, but covers enough for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden and documents all five parameters, including the kind enum values (INDEX, TABLE, SCHEMA) and the config-sourced 'target'. The 'concurrently' entry merely restates the field name ('Rebuild with CONCURRENTLY') without explaining reduced locking, so it is not complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Starts with a specific verb+resource ('REINDEX an index/table/schema') and adds a parenthetical that clarifies semantics ('rebuild in place, no undo'), which cleanly separates it from siblings like run_vacuum, run_analyze, and create_index.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives one concrete usage pointer ('Pass dry_run=True to preview'), which is helpful, but never states when to choose reindex over run_vacuum/create_index or when reindexing is inappropriate. Usage is implied rather than framed against alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.