Query business metrics
metrics_queryRun aggregate queries over charges, transactions, or distributions to compute counts, sums, averages, and min/max, grouped by date buckets or dimensions with filters.
Instructions
Run an aggregate query over this environment's charges, transactions or distributions (counts, sums, grouped by date bucket or dimension).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "metrics_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The metrics query: a resource (charges, transactions or distributions), metrics to aggregate, an ISO 8601 dateRange, optional filters and groupBy. The environment is always this server's own and is filled in automatically. |