Skip to main content
Glama
arthurxavier106

duckdb-analytics-mcp

explain

Read-onlyIdempotent

View a query's physical plan and estimated row count without executing it. Use when a query is expensive or timed out to spot costly joins before they waste compute.

Instructions

Show the query plan and estimated row count WITHOUT executing the query.

Use this when a query might be expensive, or after one has timed out. The estimate comes from DuckDB's optimizer, so it is an estimate, not a guarantee -- but it is enough to catch an accidental cross join before it runs for fifteen seconds.

Args: sql (str): The SELECT to plan. It is not executed.

Returns: str: Markdown containing the estimated cardinality, a verdict on whether the query is worth running, and the physical plan.

On failure: "Error: <guard message>" for non-SELECT input.

Examples: - Use when: a previous query hit the timeout. - Use when: joining two large tables for the first time. - Don't use when: you just want the answer (call query directly).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesOne SELECT statement in DuckDB SQL. CTEs, joins, window functions and UNION are supported. Anything that writes (INSERT, UPDATE, DELETE, CREATE, DROP, COPY, ATTACH, PRAGMA) is rejected, as are multiple statements separated by semicolons.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Beyond annotations (readOnlyHint=true, idempotentHint=true), the description explains that estimates come from DuckDB's optimizer and are not guarantees. It also discloses the failure guard for non-SELECT input and the markdown return format, adding meaningful behavioral context beyond what annotations provide.

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?

Every sentence serves a purpose: purpose, usage guidance, parameter note, return value, failure handling, and examples. The sectioned format with bolded examples is well-structured and front-loaded with the key point (no execution). No fluff.

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?

This is a near-complete specification: purpose, usage, return format, failure behavior, and guard conditions. The single parameter is fully documented in the schema, and the description clearly explains the output type (Markdown string) even without the output schema being shown.

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?

The schema already describes the sql parameter in great detail (100% coverage), including supported constructs and rejected statements. The 'Args' line in the description restates what the schema says without adding new semantics. Baseline 3 is appropriate since schema does the heavy lifting.

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 uses a specific verb ('Show') and resource ('query plan') and immediately clarifies the tool does not execute the query. This cleanly distinguishes it from sibling tools like 'query' and other data operations. The scope is unambiguous.

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 (expensive queries, timeouts) and when not to use it ('you just want the answer (call query directly)'). It names the alternative sibling tool directly, fully satisfying the when/when-not/alternatives criterion.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arthurxavier106/duckdb-analytics-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server