Skip to main content
Glama

analyze_query_indexes

Read-onlyIdempotent

Recommend indexes for up to 10 SELECT queries by comparing planner costs with hypothetical indexes; nothing is created.

Instructions

Recommend indexes for up to 10 given SELECT queries, by comparing planner costs with hypothetical indexes (hypopg). Nothing is created.

Input Schema

NameRequiredDescriptionDefault
queriesYesUp to 10 SELECT queries, with values or with $1-style placeholders
max_index_size_mbNoSize budget for all recommended indexes together, in MB (default 10000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, and non-destructive behavior. The description adds useful context beyond that: it explains that recommendations are derived by comparing planner costs using hypothetical indexes, and explicitly reassures 'Nothing is created.'

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?

A single tight sentence with the core action and scope front-loaded, followed by the method and a key safety clarification. No wasted wording.

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 simple two-parameter analysis tool with rich annotations and no output schema, the description covers purpose, scope, method, and non-destructive behavior. It could say more about expected output format or query validity requirements, but the essentials are present.

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. The description restates the query limit and SELECT-only constraint, but adds no new meaning for max_index_size_mb beyond what the schema provides, so the baseline of 3 applies.

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 (recommend indexes) and constrains scope to up to 10 given SELECT queries, which distinguishes it from the workload-oriented sibling analyze_workload_indexes. It also names the mechanism (hypothetical indexes via hypopg).

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?

The 'up to 10 given SELECT queries' scope clearly signals when this tool is appropriate rather than a workload-wide analysis. It does not explicitly name analyze_workload_indexes as the alternative, but the context is strong enough to guide selection.

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