Skip to main content
Glama

explain_query

Explain a SQL query's execution plan and optionally simulate hypothetical indexes to identify performance bottlenecks and optimize queries.

Instructions

Explain a SQL query and optionally simulate hypothetical indexes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL query to explain
analyzeNoExecute the statement to collect actual statistics
hypothetical_indexesNoHypothetical index definitions
Behavior3/5

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

The description mentions the key behavior of explaining a query and optionally simulating indexes, but it does not disclose that when 'analyze' is true, the query is actually executed (side effect). No permissions or other behavioral traits are covered. Since no annotations are provided, the description carries the full burden but misses important details.

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?

The description is a single efficient sentence that front-loads the main purpose. However, it could be slightly expanded to cover key behavioral notes without losing conciseness.

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

Completeness2/5

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

The tool supports advanced features like hypothetical indexes and analyze, but the description does not explain output, interpretation, or caveats. No output schema exists, and no annotations are provided, so the description should do more to set expectations for a complex EXPLAIN tool.

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?

The schema covers all three parameters with descriptions. The tool description adds no further meaning beyond restating the core action. Baseline 3 is appropriate given 100% schema coverage.

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?

The description clearly states the verb 'explain' and the resource 'SQL query', and it adds the optional feature of simulating hypothetical indexes. This effectively distinguishes it from sibling tools like 'execute_sql' and various analysis tools.

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 implied (explain SQL queries) but there is no explicit guidance on when to use this tool versus alternatives like 'execute_sql' or 'analyze_query_indexes'. No when-not-to-use or context for choosing among siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/surajmandalcell/pgsql-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server