Skip to main content
Glama

Queries Get Query Plan

queries_get_query_plan
Read-onlyIdempotent

Generate the EXPLAIN execution plan for a SQL query without executing it. Review performance and diagnose issues before running the query.

Instructions

Generate the EXPLAIN execution plan for a SQL query without executing it.

Input Schema

NameRequiredDescriptionDefault
queryYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.4

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds the valuable non-execution guarantee, but says nothing about permissions/context needed, whether arbitrary statement types are accepted, or failure behavior for invalid SQL.

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?

One sentence, front-loaded with the action and resource, with the critical non-execution caveat appended. Zero filler.

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 single-parameter read-only tool with rich annotations and an output schema, the description is nearly sufficient — return values need not be explained. Minor gaps remain around statement-type restrictions and error behavior, but nothing essential is 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 0% for the single 'query' parameter, but the name is self-evident and the description makes clear it is a SQL query. No additional semantic detail (e.g., dialect limits, placeholder handling, multi-statement support) is provided.

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 and resource ('Generate the EXPLAIN execution plan for a SQL query') with a clear constraint ('without executing it') that implicitly separates it from queries_query and queries_execute_dml. It does not name a sibling explicitly, so it falls just short of the top tier.

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 phrase 'without executing it' implies the usage scenario (inspecting a plan safely rather than running the query), but there is no explicit when-to-use, when-not-to-use, or named alternative such as queries_query. Usage is inferable rather than stated.

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

Deploy Server

Other Tools