call_stats
Aggregate call totals and selected metrics server-side by source, campaign, keyword, or other dimensions for date ranges and filters, avoiding pagination through individual calls.
Instructions
Server-side call aggregation via CallRail's /calls/summary.json.
One request instead of paginating every call. Prefer this over
call_summary (which fetches and counts calls client-side) when
you only need grouped totals. call_summary remains useful for
metrics this endpoint doesn't expose (first-time vs repeat split,
per-source-name breakdown, exact duration sums).
Args:
group_by: Dimension to group by. One of: 'source', 'keywords',
'campaign', 'referrer', 'landing_page', 'company'.
days: Lookback (default 30). Ignored if start_date given.
start_date / end_date: 'YYYY-MM-DD'. Explicit dates win.
company_id: Filter to one company.
fields: Comma-separated metrics, e.g.
'total_calls,missed_calls,answered_calls,first_time_callers,
average_duration,leads'. Default: total_calls only.
account_id: Auto-resolves if omitted.
Returns:
JSON string with start_date, end_date, time_zone,
total_results and grouped_results[] ({key, }).
Server-side filters (documented, live-verified 2026-10-05):
answer_status ('answered' | 'missed' | 'voicemail'; missed includes
voicemail), direction, device, lead_status ('good_lead' |
'not_a_lead' | 'not_scored'), first_time_callers, min_duration /
max_duration (seconds), tags (any of), tracker_ids, search
(phone fragment, name, note, source) and time_zone (IANA; also sets
"today" for days). fields is validated against
VALID_CALL_STATS_FIELDS.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "call_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| tags | No | ||
| device | No | ||
| fields | No | ||
| search | No | ||
| end_date | No | ||
| group_by | No | source | |
| direction | No | ||
| time_zone | No | ||
| account_id | No | ||
| company_id | No | ||
| start_date | No | ||
| lead_status | No | ||
| tracker_ids | No | ||
| max_duration | No | ||
| min_duration | No | ||
| answer_status | No | ||
| first_time_callers | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |