Skip to main content
Glama
io.github.0xmortuex/duckdb-mcp

io.github.0xmortuex/duckdb-mcp

by 0xmortuex

explain_query

Show DuckDB execution plans for SELECT queries without returning rows, and use analyze mode to inspect per-operator timings and row counts when diagnosing slow queries.

Instructions

Show DuckDB's execution plan for a SELECT query without returning its rows.

Useful to check whether a filter is pushed down into a Parquet scan, or why a query is slow. With analyze=true the query is actually executed and per-operator timings and row counts are included (still read-only, still time-limited). Same SQL rules and file naming as query.

Input Schema

NameRequiredDescriptionDefault
sqlYes
analyzeNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the safety burden and does so: it declares the operation read-only, states it is time-limited, and warns that analyze=true actually executes the query (a real cost/side-effect disclosure) while returning timings and row counts. What it omits is the concrete time limit and any error/failure behavior, so not a full 5.

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 action and scope, then motivation, then the analyze=false/true distinction. Nothing is padding; even 'still read-only, still time-limited' adds reassurance tied to the executing mode.

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?

An output schema exists, so return values need not be described, and the description covers the essential behavior for a two-parameter read/explain tool. Gaps are minor: no statement of the actual time limit, and the 'file naming' reference assumes familiarity with the file-oriented siblings.

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 0%, so the description must compensate and largely does: analyze=true is explained with its exact effect (executes the query, adds per-operator timings and row counts) and its default-off implication. The `sql` parameter gets only the indirect hint 'Same SQL rules and file naming as `query`', leaving the expected SQL dialect/statement form partly inferred from a sibling.

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 ('Show DuckDB's execution plan for a SELECT query') plus the key scope qualifier ('without returning its rows'), which cleanly separates it from the `query` sibling that does return rows. An agent can pick between them without opening a schema.

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?

Gives concrete when-to-use contexts ('check whether a filter is pushed down into a Parquet scan, or why a query is slow') and implicitly routes row-fetching to `query` via 'without returning its rows'. It lacks an explicit when-not-to-use statement or a pointer naming `query` as the alternative action, so it falls 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.