Skip to main content
Glama
FelipeRego

dbtBigQuery

by FelipeRego

query_metrics

Run governed metric queries through MetricFlow to return rows plus definitions, assumptions, and failure modes, enabling metric analysis without writing SQL.

Instructions

Run a metric query through MetricFlow and return the rows, together with the
governed definition of every metric involved.

Args:
    metrics: Metric names, comma-separated. Must already exist in the layer.
    group_by: Dimensions to group by, comma-separated, in MetricFlow's
        `entity__dimension` form (e.g. `user__acquisition_medium`).
        Use `metric_time` for the metric's own time axis, optionally with a
        grain suffix such as `metric_time__week`.
    start_time: Inclusive ISO date lower bound on metric_time, e.g. 2021-01-01.
    end_time: Inclusive ISO date upper bound on metric_time.
    where: A MetricFlow filter expression, e.g.
        "{{ Dimension('user__first_device_category') }} = 'mobile'".
        Dimensions must be referenced through the Dimension() wrapper; raw
        column names are rejected by the layer, not by this server.
    order_by: Fields to sort by, comma-separated. Prefix with `-` for
        descending, e.g. `-metric_time`.
    limit: Maximum rows to return. Capped at 500.

The response always includes a `governance` block. Report it alongside the
numbers rather than presenting the figures bare.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
whereNo
metricsYes
end_timeNo
group_byNo
order_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.6/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does so well. It discloses the mandatory governance block, the requirement to use the Dimension() wrapper in where (and that raw columns are rejected by the layer, not the server), the limit cap of 500, and the inclusive ISO date bounds. It doesn't mention permissions or side effects, but as a read-only query tool this is sufficient.

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 is well-structured with a clear 'Args' section, and every sentence adds value. It front-loads the purpose and then details parameters without redundancy. The length is appropriate for the tool's complexity, and there is 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?

Given the tool's complexity (7 parameters, one required) and the existence of an output schema, the description is complete. It covers all parameters, gives usage examples, and highlights the governance block in the response. There is no missing information an agent would need to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain all seven parameters—and it does comprehensively. It gives format examples for group_by, start_time, end_time, where, order_by, and limit, and clarifies constraints like the metric_time grain suffix and the cap at 500. This fully compensates 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 description opens with a specific verb ('Run a metric query') and resource ('through MetricFlow'), and states the output: rows plus governed definitions. This clearly distinguishes it from siblings like list_metrics (which enumerates metrics) and describe_metric (which explains a single metric).

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 provides clear context for when to use the tool—when you need metric data rows with governance—and gives prerequisites (metrics must exist in the layer). It does not explicitly name alternatives or say when not to use it, but the purpose is so specific that an agent can infer the appropriate context.

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