Skip to main content
Glama
FelipeRego

dbtBigQuery

by FelipeRego

explain_metric_sql

Preview the SQL MetricFlow would run for a metric query, revealing computation logic and letting you assess warehouse costs before execution.

Instructions

Return the SQL MetricFlow would run for a query, without running it.

Args:
    metrics: Metric names, comma-separated.
    group_by: Dimensions to group by, comma-separated.
    start_time: Inclusive ISO date lower bound on metric_time.
    end_time: Inclusive ISO date upper bound on metric_time.
    where: A MetricFlow filter expression.

Useful for showing a person how a metric is actually computed, and for
checking a query's cost before spending warehouse credits on it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
whereNo
metricsYes
end_timeNo
group_byNo
start_timeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It clearly states that the tool does not execute the query and instead returns SQL, and it explains the diagnostic purpose. It does not discuss permissions or failure modes, but for a read-only explanation tool this is a minor gap.

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 opens with a crisp definition, then a tight parameter list, then two concise use-case sentences. Every sentence earns its place, and there is no redundant restatement of the schema.

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?

All five parameters are described, the non-executing behavior is explicit, and the use cases are clear. The output schema covers return value details, so the description need not explain those. The only minor gap is not explicitly naming query_metrics as the alternative for when actual results are needed.

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 description coverage is 0%, so the parameter block in the description is essential. It documents all five arguments with meaningful semantics: comma-separated metric names, grouping dimensions, inclusive ISO date bounds on metric_time, and a MetricFlow filter expression. The `where` grammar is slightly vague, but the description compensates well for the missing schema descriptions.

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 first sentence states a specific action and resource: 'Return the SQL MetricFlow would run for a query, without running it.' This clearly distinguishes the tool from query_metrics, which would execute the query and return data. 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 Guidelines4/5

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

The description gives concrete use cases: showing how a metric is computed and checking query cost before spending warehouse credits. It does not explicitly name query_metrics as the alternative when execution is desired, but the 'without running it' phrasing establishes the boundary clearly.

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