Skip to main content
Glama

suggest_index

Analyze SQL via EXPLAIN PLAN to detect full table scans and return a CREATE INDEX DDL recommendation. Not executed; apply after review.

Instructions

Analyse a SQL statement via EXPLAIN PLAN and, when a table is read by full scan, propose a CREATE INDEX statement. Returns the recommended DDL as text; it is never executed. Apply it manually only after DBA review.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL statement to analyse (typically SELECT; DML is also supported).
targetTableNoOptional table name to focus on when several tables are scanned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.16.3

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the disclosure burden and does well: it states the recommendation is returned as text and is never executed, and that manual DBA review is required. It omits operational details such as PLAN_TABLE/permission prerequisites for EXPLAIN PLAN or what happens on unsupported statements.

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

Conciseness5/5

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

Two tight sentences with zero filler; the core action and the crucial 'never executed' guarantee come first, followed by the human-review constraint.

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 read-only advisory tool with no output schema, the description covers the return value (DDL text) and the safety posture, which is what an agent most needs. Minor gaps remain around prerequisites for EXPLAIN PLAN, but nothing essential to invoking it correctly is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so both parameters are already documented in the schema; the description adds no extra syntax or format guidance for 'sql' or 'targetTable'. Baseline 3 applies when the schema does the heavy lifting.

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+resource: analyse a SQL statement via EXPLAIN PLAN and propose a CREATE INDEX DDL when a full scan is detected. It is clearly distinguishable from sibling create_index (which executes) and explain_plan (which only plans), so an agent can route correctly.

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 a clear triggering condition ('when a table is read by full scan') and a post-call workflow ('Apply it manually only after DBA review'). It does not explicitly name alternatives such as explain_plan or run_sql_tuning_advisor for related tuning tasks, so it stops short of full when/when-not routing.

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