analytics_query
Query product analytics. Filter by event name and time range; group by hour, day, event, or user. Returns aggregated counts and numeric sums.
Example:
{
"project_id": "my-saas",
"event": "purchase_completed",
"from": "2026-04-01",
"to": "2026-04-20",
"group_by": "day"
}
// Returns: [{ "date": "2026-04-01", "count": 12, "sum_amount": 587.88 }, ...]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_id": "<project_id>"
},
"name": "analytics_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Optional end time — ISO-8601 string or unix-ms integer. | |
| from | No | Optional start time — ISO-8601 string or unix-ms integer. | |
| event | No | Optional event name to filter on. If omitted, all events match. | |
| limit | No | Max rows (default 1000, max 10000). | |
| group_by | No | Optional. One of: hour, day, event, user. Omitted: raw event rows (most recent first). | |
| project_id | Yes | Project ID (UUID), subdomain, or slug — resolved server-side, no UUID lookup needed. 'default' also works when the account has exactly one project; multi-project accounts must name one (the error lists them). |