Skip to main content
Glama

explain_query

Generate an execution plan for a SQL query to analyze performance and identify optimization opportunities.

Instructions

Get the execution plan for a SQL query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe SQL query to analyze
formatNoOutput format for the execution plantext
analyzeNoRun EXPLAIN ANALYZE for actual execution stats
connectionIdYesThe ID or name of the database connection
Behavior2/5

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

With no annotations, the description carries the full burden of disclosing behavior. It says 'execution plan' but does not clarify whether the query is executed, how EXPLAIN ANALYZE affects behavior, or whether the operation is read-only. This is a significant gap for a tool that may run queries.

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, efficient sentence that immediately conveys the core purpose. There is no redundant or filler content.

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?

Given four parameters, no annotations, and no output schema, the description is too sparse. It fails to explain return values, whether the query executes, or how the analyze option changes behavior, leaving important context missing.

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 the schema already documents all four parameters. The description adds no additional semantic context about parameters, resulting in a baseline score with no extra value.

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 tool's function: obtaining an execution plan for a SQL query. This distinguishes it from siblings like execute_query and write_query, which perform different operations.

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?

The description implies use when a SQL execution plan is needed, but it does not explicitly state when to choose this over execute_query or provide any exclusions. There is no explicit when/when-not guidance or mention of alternatives.

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/sangamkotalwar/omnisql-mcp'

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