Skip to main content
Glama

explain_metric_query

Read-onlyIdempotent

Compile a metric query into governed SQL without running it. Inspect the generated query to verify metrics, dimensions, filters, and sorting before execution.

Instructions

Compile a metric query and return the governed SQL without running it.

Input Schema

NameRequiredDescriptionDefault
endNo
limitNo
startNo
filtersNo
metricsYes
order_byNo
descendingNo
dimensionsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so safety is covered. The description still adds a genuinely useful behavioral fact beyond the annotations: it compiles and returns SQL only, executing nothing and therefore returning no data rows — a distinction read-only alone does not convey. It omits error behavior for invalid metrics or permission requirements.

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?

A single front-loaded sentence with zero filler; the compile action and the no-execution constraint are both delivered immediately. Nothing is redundant with the name or title.

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?

An output schema exists, so return values need not be described, but for an 8-parameter tool with no schema-level parameter descriptions and no usage guidance, one sentence is not enough. Key call-site knowledge — what metrics/dimensions identifiers must reference, date formats, and default windowing — is entirely absent.

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 8 parameters (only nested MetricFilter fields carry descriptions), so the description is expected to compensate for metrics, filters, dimensions, start/end, limit, order_by and descending. The one-sentence description mentions no parameter at all, so an agent gets no added semantics for any of them.

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 (compile), resource (metric query) and output (governed SQL), and the clause 'without running it' implicitly separates it from the executing sibling query_metric. An agent can distinguish this dry-run/compile tool from list_metrics, describe_metric and query_metric 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'without running it' implies the intended use case (inspecting/validating SQL before execution) and hints at the alternative query_metric, but no sibling is named and there is no explicit when-to-use vs when-not guidance. Usage is implied rather than stated.

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