Event Aggregate
rybbit_get_event_aggregateAggregate analytics events by one or more dimensions, filter by event name or properties, and return grouped counts with first/last seen and session totals.
Instructions
Aggregate events by one or more dimensions (e.g. identified_user_id, traits.username, pathname, properties.plan). Filters by event_name and optional property filters, then groups remaining events. Returns { groups: [{key, count, first_seen, last_seen, sessions, extras}], scanned, hitCount, hasMore }. When hasMore: true, the scan stopped at maxScan before the start of the range: narrow the time window or raise maxScan. Events are read in pages of 1000, roughly 0.5 s each: the default maxScan of 5000 takes about 3 s, 50000 about 20 s.
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": {
"siteId": "<siteId>",
"groupBy": "<groupBy>"
},
"name": "rybbit_get_event_aggregate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topN | No | Return only the top N groups by count (default 50). | |
| siteId | Yes | Site ID (numeric ID or domain identifier) | |
| endDate | No | End date in ISO format (YYYY-MM-DD) | |
| filters | No | Array of filters. Example: [{parameter:'browser',type:'equals',value:['Chrome']},{parameter:'country',type:'equals',value:['US','DE']}] | |
| groupBy | Yes | One or more group keys. Built-in: 'identified_user_id', 'user_id', 'pathname', 'hostname', 'country', 'browser', 'device_type', 'traits.username', 'traits.plan'. Use 'properties.<name>' to group by an event property (e.g. 'properties.plan'). | |
| maxScan | No | Maximum events to read, newest first (default 5000). | |
| timeZone | No | IANA timezone (e.g., Europe/Prague). Default: UTC | |
| eventName | No | Optional exact event_name to filter for (e.g., 'signup'). | |
| startDate | No | Start date in ISO format (YYYY-MM-DD) | |
| pastMinutesEnd | No | Alternative to dates: minutes ago end (default 0 = now) | |
| propertyFilters | No | Filters applied to parsed event properties after fetch. | |
| pastMinutesStart | No | Alternative to dates: minutes ago start (e.g., 60 = last hour) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Caveat about this response, e.g. how many rows were returned and how to get the rest | |
| groups | Yes | Grouped event counts, sorted by count DESC by default | |
| hasMore | Yes | True if scan was capped by maxScan and more data exists | |
| scanned | Yes | Total events scanned across pagination | |
| hitCount | Yes | Events matching eventName / property filters | |
| truncated | No | True when rows were dropped to keep the response under the size cap | |
| windowEnd | No | ||
| windowStart | No |