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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| where | No | ||
| metrics | Yes | ||
| end_time | No | ||
| group_by | No | ||
| order_by | No | ||
| start_time | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||