Skip to main content
Glama
igorolv

jdbc-mcp-server

explainQuery

explainQuery
Read-onlyIdempotent

Retrieve the full engine-specific execution plan for a SELECT or WITH query to inspect raw database planner details. Use when you need granular plan output rather than compact performance analysis.

Instructions

Return the full engine-specific textual execution plan for a SELECT / WITH statement. Use when raw plan detail is needed; prefer analyzePlan for compact performance findings. Bind '?'->params, ':name'->namedParams; never mix. E.g. :status -> namedParams={status:'PAID'} — key is the bare name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
paramsNoValues for '?' placeholders, in order.
analyzeNoExecute the query to collect runtime stats where supported (default false).
connectionYesDatabase to run against. Call listConnections for valid names; do not guess.
namedParamsNoValues for ':name' placeholders, keyed by name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, covering the safety profile. The description adds useful behavioral context beyond that: the return is a full engine-specific textual plan, and parameter binding follows strict '?' vs ':name' conventions that must not be mixed. This is meaningful operational transparency for an agent.

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 three sentences with no filler. It front-loads the core purpose, then gives usage guidance, then explains parameter binding with an example. Every sentence contributes essential information.

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

Completeness5/5

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

Despite having no output schema, the description tells the agent the return kind ('textual execution plan') and the tool's scope. Combined with the schema's parameter descriptions and the annotations' safety profile, the agent has enough information to select and invoke the tool correctly. The explicit binding rule and sibling alternative complete the picture.

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

Parameters4/5

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

Schema coverage is 80%, so the schema already documents most parameters. The description adds value by clarifying the binding model: '?' maps to params, ':name' maps to namedParams, and the example shows that the key is the bare name without the colon. This goes beyond the schema descriptions and reduces ambiguity.

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 opens with a specific verb and resource: 'Return the full engine-specific textual execution plan for a SELECT / WITH statement.' It also distinguishes itself from analyzePlan by contrasting raw plan detail with compact performance findings, making sibling differentiation clear.

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

Usage Guidelines5/5

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

It explicitly states when to use the tool ('Use when raw plan detail is needed') and names the preferred alternative for compact performance findings ('prefer analyzePlan'). This gives an agent concrete routing guidance rather than leaving the choice implied.

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