Skip to main content
Glama

explain_query

Explain SQL queries and simulate hypothetical indexes to identify performance bottlenecks.

Instructions

EXPLAIN a SQL query, optionally with hypothetical indexes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dbNoDatabase id from list_databases
sqlYes
analyzeNo
hypothetical_indexesNo
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does not state whether the query is executed, whether the operation is read-only, what output format is returned, or any side effects. The word 'EXPLAIN' implies a query plan, but that is not explicit.

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?

The description is a single, front-loaded sentence with no wasted words. 'EXPLAIN a SQL query, optionally with hypothetical indexes' delivers the core purpose efficiently.

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

Completeness1/5

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

The tool has no output schema and no annotations, yet the description does not explain what the EXPLAIN output looks like, how `analyze` affects results, or how `db` is used. The nested `hypothetical_indexes` object is also left ambiguous. This is inadequate for a tool with four parameters and no structured output documentation.

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

Parameters2/5

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

Schema description coverage is only 25% (only `db` is described). The description maps 'SQL query' to `sql` and 'hypothetical indexes' to `hypothetical_indexes`, but it does not explain `analyze` or `db`, nor the structure of hypothetical indexes beyond the name. It partially compensates for low schema coverage but not sufficiently.

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 uses a specific verb ('EXPLAIN') and resource ('SQL query'), and mentions the optional hypothetical-index capability. This clearly distinguishes the tool from siblings like execute_sql, which runs queries rather than explaining them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives such as execute_sql, analyze_query_indexes, or get_top_queries. The description does not state conditions, prerequisites, or exclusions, providing only the basic action.

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/Leon-Achteresch/postgres-mcp'

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