Query
queryUse query when other tools cannot answer. Returns grouped metric rows. property is the event property key and is required when any of those metrics is requested. Numeric metrics are Pro, with the same gating as this query, and a free account gets 403 PRO_REQUIRED. Hosted vitals are properties on page_view when the snippet has data-track-vitals="true". Use web_vitals for the p75 headline. Missing property is 400 MISSING_FIELDS. A bad key is 400 INVALID_PROPERTY_KEY. Percentiles use nearest_rank. group_by allows at most one properties. matching ^[A-Za-z0-9_]{1,128}$; another is 400 INVALID_GROUP_BY. email uses a project-scoped HMAC.
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": {
"project": "<project>"
},
"name": "query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Customer email, matched by HMAC and not stored. | ||
| limit | No | Max results (default 100, max 1000) | |
| order | No | Sort direction | desc |
| date_to | No | End date (ISO 8601). Defaults to today. | |
| filters | No | Filters to apply | |
| metrics | No | Metrics. sum, avg, and percentiles need property. | |
| project | Yes | Project name | |
| group_by | No | Group fields. At most one properties.<key>. | |
| order_by | No | Field to sort by. Aggregate metrics such as p75 are allowed when requested | |
| property | No | Property key to aggregate. Required for sum, avg, p50, p75, or p95. | |
| date_from | No | Start date, ISO or Nd such as 30d. | |
| count_mode | No | event_count mode. Default session_then_user. |