query_events
Note: this tool holds data for a limited timeframe — only the last ~7-14 days are available, depending on the container.
Paginated list of raw events for a date range, with filters (event_name, source, status, and 10 has_* click-ID presence flags).
DATA RETENTION: the v2 store currently holds only the last ~7-14 days. Older date_from values pass validation but return empty rows. A "warnings" array is added when date_from is outside the retention window.
USE WHEN:
User wants to loop through all events for a given date range, inspecting data from each one in detail.
User wants to enumerate events matching a filter (e.g. "show all Purchase events with gclid this week", "list error events from yesterday").
User explicitly wants raw event records, not aggregates.
DON'T USE for counts, totals, top-N rankings, breakdowns by source/day — use get_report (orders of magnitude faster on aggregates). For a single event by ID, use list_events.
STATUS FILTER: defaults to "processed" — these are the real, successfully-recorded events that nearly every analytics question is about. Only set status explicitly when debugging delivery/ingestion issues: "pending" (queued, not yet processed), "error" (processing failed), "rejected" (validation/spam blocked). Asking for non-processed events without a debugging reason will mislead the user.
Pagination is cursor-based: pass the returned meta.cursor.next_cursor back as cursor on the next call. Stop when has_more is false. Backend caps date range at 30 days.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | Pagination cursor from a previous response's meta.cursor.next_cursor. | |
| source | No | Filter by traffic source | |
| status | No | Filter by event status. Default: "processed" (real, successfully-recorded events — what nearly every analytics question is about). Override only for debugging: "pending" (queued), "error" (processing failed), "rejected" (validation/spam blocked). | |
| date_to | Yes | End date (YYYY-MM-DD) | |
| has_epik | No | Only events arriving with a Pinterest epik | |
| per_page | No | Items per page (default 50, max 1000 on v2). v2 SQLite reads are fast enough to prefer larger pages over more cursor round-trips. | |
| date_from | Yes | Start date (YYYY-MM-DD) | |
| has_adfcd | No | Only events arriving with an Adform adfcd | |
| has_gclid | No | Only events arriving with a Google Ads gclid | |
| event_name | No | Filter by event name | |
| has_fbclid | No | Only events arriving with a Facebook fbclid | |
| has_lsclid | No | Only events arriving with an lsclid | |
| has_scclid | No | Only events arriving with a Snapchat scclid | |
| has_ttclid | No | Only events arriving with a TikTok ttclid | |
| has_ga4clid | No | Only events arriving with a GA4 client ID | |
| has_msclkid | No | Only events arriving with a Microsoft msclkid | |
| has_rdt_cid | No | Only events arriving with a Reddit rdt_cid | |
| server_name | No | Server name (required when connected to multiple servers). | |
| container_id | Yes | Container ID (starts with "trc_"). | |
| has_li_fat_id | No | Only events arriving with a LinkedIn li_fat_id |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meta | Yes | ||
| events | Yes | ||
| warnings | No |