Skip to main content
Glama

reindex

Rebuild PostgreSQL indexes, tables, or schemas to reduce bloat and improve performance. Use dry-run to preview before applying.

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
Behavior3/5

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

With no annotations, the description carries the full burden. It specifies '[WRITE][risk=medium]' and 'no undo', but lacks details on performance impact, locking behavior, or required permissions.

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?

The description is well-structured with a clear first line and a parameter list. It is reasonably concise, though the docstring format adds some verbosity.

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?

The description explains the core behavior, parameters, and warns about irreversibility. It does not cover return values or error conditions, but given no output schema, it is fairly complete.

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

Parameters5/5

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

Schema description coverage is 0%, but the description includes a detailed docstring explaining each parameter's purpose (e.g., 'dry_run: If True, preview without rebuilding'), fully compensating.

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?

The description clearly states the verb 'REINDEX' and the resource 'index/table/schema', and it distinguishes from siblings like 'create_index' and 'drop_index' by focusing on in-place rebuild.

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?

The description mentions 'no undo' and suggests using dry_run for preview, providing basic guidance. However, it does not explicitly contrast with alternatives like 'run_vacuum' or other index maintenance tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AIops-tools/Postgres-AIops'

If you have feedback or need assistance with the MCP directory API, please join our Discord server