Skip to main content
Glama

analyze_query_indexes

Read-only

Analyzes up to 10 SQL queries and recommends optimal indexes to improve PostgreSQL query performance.

Instructions

Analyze a list of (up to 10) SQL queries and recommend optimal indexes

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": {
      "queries": "<queries>"
    },
    "name": "analyze_query_indexes"
  }
}

Input Schema

NameRequiredDescriptionDefault
methodNoMethod to use for analysisdta
queriesYesList of Query strings to analyze
max_index_size_mbNoMax index size in MB

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds the 10-query cap, which is useful behavioral context, but says nothing about cost, latency, or how the two analysis methods differ in behavior.

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 front-loaded sentence with no filler; the scope limit is embedded where it is most useful. Nothing is wasted or buried.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description could say what a recommendation looks like (index definitions, estimated benefit) and when the llm method is preferable to dta. For a three-parameter analysis tool it is adequate but leaves real gaps.

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 all three parameters are already documented, including the dta/llm enum and the max_index_size_mb default. The description only adds the query-count ceiling, which is marginal value over the schema; baseline 3 applies.

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?

States a specific verb ('Analyze'), resource ('SQL queries'), and output ('recommend optimal indexes'), plus a concrete scope limit of up to 10 queries. It does not differentiate itself from the sibling analyze_workload_indexes, so an agent cannot tell from the text alone which analyzer to pick.

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 is only implied by the 'up to 10 queries' constraint, which hints at small ad-hoc sets rather than full workloads. There is no explicit when-to-use, when-not-to-use, or named alternative such as analyze_workload_indexes or explain_query.

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