Skip to main content
Glama

explain_query

Read-onlyIdempotent

Returns the optimized SQL and DuckDB execution plan for a metrics request without running it, so you can review or paste the query into a BI dashboard.

Instructions

Return the optimized SQL and DuckDB plan for a request, without running it.

Same arguments as query_metrics. Useful to paste the query into a BI dashboard.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
date_toNo
filtersNo
metricsYes
order_byNo
date_fromNo
descendingNo
dimensionsNo
with_shareNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so safety is covered structurally. The description's 'without running it' is genuinely additive behavioral information, confirming no query execution or side effects occur, which is the main thing an agent needs to know here. It stops short of describing the shape/size of the returned plan.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, with the core non-execution behavior front-loaded. The second sentence ('useful to paste into a BI dashboard') is slightly tangential but does earn its place as a usage hint rather than pure padding.

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

Completeness2/5

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

For a 9-parameter tool with no output schema and no schema descriptions, the definition does not explain what any argument means or what the returned plan looks like. The sibling-argument reference is the only mitigation, leaving the agent under-equipped to invoke this correctly.

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% across 9 parameters, so the schema supplies no parameter meaning at all. 'Same arguments as query_metrics' is a pointer rather than an explanation and conveys nothing about metrics, filters, dimensions, date ranges, or the limit default, leaving the agent to infer everything.

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) plus the exact artifacts produced (optimized SQL and DuckDB plan) and adds the crucial qualifier 'without running it'. That qualifier cleanly distinguishes it from the sibling query_metrics, which actually executes.

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?

'Same arguments as query_metrics' tells the agent the call shape matches the executing sibling, implying it is the non-executing counterpart. The BI-dashboard example gives a concrete use case, but there is no explicit when-not-to-use statement or exclusion relative to query_metrics.

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