What it does
Time-bucketed metric over a period. metric=pageviews includes AI-mediated human browsing (ai_user_action); metric=sessions and metric=visitors are browser-only, since server-side-ingested rows carry no session or visitor id — see traffic_class_breakdown for the AI-vs-direct split. metric=visitors is always 0 on privacy_mode=strict sites (no visitor IDs computed by design) — use sessions there. metric=events trends one named event (pass event_name) — the way to chart a conversion event over time, rather than calling event_details once per day; it counts rows like pageviews, so it includes AI-mediated human browsing.
Example prompts
Ask:
"Show me pageviews day-by-day for the last 30 days on mysite.com."
"Hourly visitor count for the last 24 hours."
"Weekly trend for sessions over the past quarter."
"Is the cta_click event trending up this month?"
A typical response:
Pageviews, daily, last 30 days for mysite.com:
2026-04-20 1,847
2026-04-21 1,920
2026-04-22 2,114
2026-04-23 8,412 ← spike (HN thread)
...
2026-05-17 8,114
2026-05-18 7,420
2026-05-19 2,890
Returns an array of { ts, value } objects.
The metric argument controls what's measured:
pageviews, visitors, sessions, or
events. The last one trends a single named custom event over
time — pass event_name alongside it (find names via
list_events).
The granularity argument controls bucket size:
hour, day, or week. Long periods
at hour-granularity return a lot of rows. Consider day or week for
ranges over 30 days.
Counts include AI-mediated human browsing. See
traffic_class_breakdown
to see the AI-vs-direct split if it matters for your interpretation.
Pair with
compare_periods
for headline-style "is this up or down?" rather than the full
day-by-day list.
Arguments
| Name | Type | Required | Description / Default |
|---|---|---|---|
site_id |
string | required | Site identifier from list_sites (8-character base32, e.g. 'wjxayhdd'). |
metric |
string enum: pageviews, visitors, sessions, events |
required | Which metric to compute over the period. pageviews includes AI-mediated human browsing; sessions and visitors are browser-only. 'events' counts occurrences of the single event named in event_name (row count, like pageviews). |
period |
string | optional |
Time window. Keywords: today, yesterday, last_7_days, last_30_days, last_90_days, last_12_months. Or a custom date range YYYY-MM-DD..YYYY-MM-DD (inclusive).
default: last_7_days
|
granularity |
string enum: hour, day, week |
optional |
Time bucket size for the series. Use 'hour' for last_24h analysis, 'day' for week/month views, 'week' for quarter+.
default: day
|
event_name |
string | optional | Required when metric=events, rejected with any other metric. Case-sensitive event name — use list_events to discover the names this site actually sends. Counts match the total_count event_details reports for the same event and period (volume metric, includes AI-mediated human browsing). |
How to call it directly
If you're integrating from your own code rather than a chat client, this is the JSON-RPC payload:
curl -X POST https://mcp-analytics.com/mcp \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_timeseries",
"arguments": {
"site_id": "abc12345",
"metric": "pageviews"
}
}
}'
Token comes from /settings after you sign up. Replace any required arguments above.
Related tools
breakdown: Breakdown of visits by browser, os, device_type, or country (country empty in MVP).list_sites: List all sites on the authenticated account.top_timezones: Top IANA timezones (Europe/Berlin, America/New_York, ...) of visitors.top_referrers: Top referring hosts.engagement_overview: Real reading time + scroll depth from the engagement beacon (fired on pagehide).