query_metric
Run governed metric queries with group-by dimensions and filters, returning rows and the exact SQL executed for transparent results.
Instructions
Compile a metric query and run it against the model's DuckDB warehouse.
Args: metric: metric name, e.g. "revenue". by: dimensions to group by, each as "entity.field", e.g. ["customers.region"]. See describe_metric's allowed_dimensions for what is safe to pass here. where: filter clauses, each as "entity.field op value", e.g. ["calendar.fiscal_year = 2025"]. limit: maximum rows to return (default 100).
Returns columns, rows, and the exact SQL that was run, so the caller can show its work
rather than just asserting a number. Raises a tool error, never a guess, if a dimension
is unknown, a join between two required entities is ambiguous or unreachable, or the
metric is declared non_additive_over a dimension in by.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| by | No | ||
| limit | No | ||
| where | No | ||
| metric | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||