Skip to main content
Glama
unfallenwill

SQLScope

by unfallenwill

Explain query plan

explain_query

Show the execution plan for any SQL statement—index usage, scan order, estimated rows—without executing it, making write statements safe to analyze.

Instructions

Show the execution plan for a statement (EXPLAIN / EXPLAIN QUERY PLAN) without running it — index usage, scan order, estimated rows. Safe on write statements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesStatement to plan (does not get executed)
paramsNoBound parameters: array for positional placeholders (?), object for named ones (:name) where the driver supports them.
connectionNoNamed connection to use. Omit when only one connection is configured (or it is named "default").

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It explicitly states that the statement is not executed and that write statements are safe, and it also describes what the plan reveals. This is strong behavioral transparency for a relatively simple tool.

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 two concise sentences with no filler. The core purpose is front-loaded, and 'Safe on write statements' adds an important behavioral note without extra verbosity.

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?

For a low-complexity tool, the description covers purpose, safety, non-execution behavior, and even the nature of the output (index usage, scan order, estimated rows). Combined with a fully documented parameter schema, an agent has enough context to select and invoke the tool correctly.

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 input schema already fully documents the sql, params, and connection parameters. The description adds no parameter-level meaning beyond the schema, which is acceptable but not 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 states a specific verb ('Show the execution plan'), a clear resource ('a statement'), and explicitly distinguishes it from execution by saying 'without running it'. This makes it easy to separate from the sibling query tool, which actually runs statements.

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 clearly communicates when to use this tool: when you need index usage, scan order, or estimated rows without executing the statement. It also notes it is safe on write statements, which is useful context, though it does not explicitly name alternative tools or list when-not-to-use conditions.

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