Skip to main content
Glama
AishwaryaDV

safe-db-mcp

by AishwaryaDV

explain_query

Return SQLite’s query plan for a SELECT without executing it to inspect how a query will run or debug slow queries.

Instructions

Return SQLite's query plan for a SELECT without executing it. Use it to check how a query will run or to debug a slow one. The same validation as run_query applies.

Input Schema

NameRequiredDescriptionDefault
sqlYes
databaseYes

Output Schema

NameRequiredDescriptionDefault
okYes
hintNo
planNo
messageNo
error_typeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses that the query is not executed and that run_query-style validation applies, but it does not state permission requirements, whether the query must be a SELECT (beyond implication), or any other error/behavioral details.

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?

Three short sentences, front-loaded with the core behavior ('Return SQLite's query plan...') and followed by usage context. Every sentence adds useful information with no filler.

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

Completeness3/5

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

An output schema exists, so return values need not be explained. However, with no annotations and 0% parameter description coverage, the description leaves important gaps about the 'database' parameter and validation/error behavior, even though the non-execution safety property is covered.

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 0%, so the description must compensate for both parameters. It implies that 'sql' is a SELECT statement, but it says nothing about the 'database' parameter or the format/meaning of either argument beyond that implication.

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?

States a specific verb and resource: returns SQLite's query plan for a SELECT. It also distinguishes itself from the likely sibling run_query by specifying 'without executing it', so an agent can tell exactly what this tool does differently.

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?

Explicitly says to use it to check how a query will run or debug a slow one, which gives clear context. It also signals that the same validation as run_query applies, though it does not explicitly name run_query as the executing alternative or state when not to use this tool.

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