Skip to main content
Glama

Suggest indexes

suggest_indexes

Analyze a SELECT query's execution plan to identify sequential scans and recommend indexes, including reasoning and the CREATE INDEX statement. Suggestions only; no indexes are created.

Instructions

Analyse a SELECT query's plan and suggest indexes for sequential scans, with reasoning and the CREATE INDEX statement. Suggestions only — this tool never creates an index.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "suggest_indexes"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe SELECT query to analyse.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full load, and it does disclose the most important behavioral fact: 'this tool never creates an index,' which is a stronger non-mutation guarantee than any annotation would give. It also states what the response contains (reasoning plus a CREATE INDEX statement). It stops short of noting that it only reasons about sequential scans or any execution cost, but the safety profile is unambiguous.

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 compact sentences, front-loaded with the action and target, followed by the payoff and the non-mutation caveat. Nothing is redundant or restates the tool name.

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 one-parameter, read-only advisory tool with no output schema, the description adequately covers input expectations, output shape (reasoning plus DDL), and side-effect posture. Only the positional dependency on a prior explanation step is left unstated.

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 coverage is 100% for the single `query` parameter, so the baseline is 3. The description reinforces a real constraint beyond the schema by framing the input as a SELECT query and tying it to a query plan, but adds no syntax, formatting, or size guidance for the parameter value.

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

Purpose4/5

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

Uses a specific verb pair ('analyse ... and suggest') against a specific resource ('indexes for sequential scans') scoped to a SELECT query's plan. An agent can easily tell this is advisory index tuning rather than generic query explanation (explain_query) or metadata inspection, though it never names a sibling explicitly.

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?

Usage context is only implied: it makes clear this is an advisory step taken after inspecting a SELECT query, and the 'suggestions only' clause signals it is not a mutation path. There is no explicit statement of when to prefer this over explain_query or table_stats, so the agent must infer the sequencing.

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