Skip to main content
Glama

drop_index

Destructive

Remove a PostgreSQL index while capturing its definition first for rollback, with dry-run preview and optional CONCURRENTLY to avoid table locks.

Instructions

[WRITE][risk=high] Drop an index. Reversible: captures pg_get_indexdef first.

Before dropping, the exact index definition is captured so the harness records
an undo that recreates it. Pass dry_run=True to preview.

Args:
    name: Index name (optionally schema-qualified).
    concurrently: Drop with CONCURRENTLY (no table lock).
    dry_run: If True, preview without dropping.
    target: Target name from config; omit for the default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
targetNo
dry_runNo
concurrentlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds substantial context beyond them: the operation is reversible because pg_get_indexdef is captured first, the undo recreates the index, and CONCURRENTLY avoids a table lock. It omits failure modes and required privileges, but the core behavioral contract is well disclosed.

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?

Front-loads the risk marker and one-line purpose, then adds the reversibility mechanism before the argument list. Slightly redundant in restating reversibility twice, but every sentence carries operational information and nothing is buried.

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?

With no output schema, four parameters at 0% schema coverage, and a destructive annotation profile, the description supplies the essential safety context (reversibility, preview mode, lock behavior). Remaining gaps — permission requirements and behavior on failure — are minor for a drop-a-single-object tool.

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 must carry the burden, and it documents all four parameters with added meaning: schema-qualified index names, CONCURRENTLY meaning no table lock, dry_run as preview-only, and target as a config name that defaults when omitted. The coverage is complete, though the explanations are terse rather than rich.

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?

States a specific verb and resource (drop an index) and immediately flags it as a write operation with high risk, distinguishing it from siblings like create_index, reindex and invalid_indexes. The scope of the operation is unambiguous from the first sentence.

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

Usage Guidelines4/5

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

Gives clear operational context: preview with dry_run=True before dropping, and the harness captures the definition so the drop can be undone. It does not explicitly name alternatives (e.g. reindex vs. drop, or point to undo_apply for reversal), so it stops short of full when/when-not guidance.

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