Skip to main content
Glama
akrym1582

sqldb-mcp-server

by akrym1582

explainQuery

Get the estimated execution plan for a SELECT query without running it. Understand how the database will execute your SQL to spot performance bottlenecks.

Instructions

Return the estimated execution plan for a SELECT SQL query without actually executing it. The response format depends on the database engine (e.g. MSSQL, PostgreSQL, MySQL) and is returned as-is from the database driver.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSELECT SQL statement whose execution plan should be retrieved
databaseNoDatabase in which to explain the query; omit to use the default

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / database
      Added value: +{
      +  "description": "Database in which to explain the query; omit to use the default",
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. First observedv0.1.1

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full disclosure burden. It discloses important behavioral traits: the query is not actually executed, the output format varies by database engine, and the result is returned as-is from the driver. It could add more detail about potential cost or failure modes, but the core safety profile is clear.

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?

Two dense sentences with no wasted words. The most important behavior, not executing the query, is front-loaded, and the output-format caveat is delivered succinctly.

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?

The description covers what input is expected, the non-execution guarantee, and the variability of the return payload. Since there is no output schema and no annotations, the description reasonably equips an agent to invoke the tool correctly, though it could more explicitly tie it to sibling selection.

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 explains both parameters. The description adds useful context about engine-dependent output but does not add meaning about individual parameters beyond what the schema provides. Baseline 3 is appropriate.

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 states a specific verb ('Return'), resource ('estimated execution plan'), and scope ('SELECT SQL query'). It also explicitly distinguishes this from actually executing the query with 'without actually executing it', which separates it from sibling tools like 'query'.

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

Usage Guidelines4/5

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

The description gives clear usage context: use it to retrieve an estimated execution plan rather than execute a query. It also constrains usage to SELECT statements. It does not explicitly name alternative siblings or state when not to use it, so it stops short of a 5.

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