spam_detector
Identify likely-spam calls using heuristic scoring based on short duration, unanswered status, and repeat caller patterns. Optionally tag flagged calls for manual review. Returns a score breakdown and caller phone histogram.
Instructions
Heuristically identify likely-spam calls and (optionally) tag them.
Spam scoring (additive): +2 if duration < 10 seconds +1 if not answered +1 if first_call AND duration < 30 seconds +1 if same caller appears >=3 times in window (likely auto-dialer) A call scoring >= 3 is flagged as likely spam.
Args:
company_id: Restrict to one company (recommended).
days: Lookback window (1-90; 90 is hard-capped to avoid memory
blowup on high-volume clients — full call list is materialized
for scoring before truncating the response).
auto_tag: If True, ADD tag_name to each likely-spam call after
the scan. Default False (preview only). Note: we deliberately
do NOT mark calls as spam=True automatically — CallRail
HIDES spam-flagged calls from default GET endpoints, so
self-reviewing them later becomes painful. Tag first, manually
spam-flag if confirmed.
tag_name: The tag to add when auto_tag=True. Default
'auto_detected_spam'. Auto-creates the tag at company level
if it doesn't exist (CallRail's behavior).
account_id: Auto-resolves if omitted.
Returns: - score breakdown by call - histogram of caller phone numbers (so you can spot a single dialer hammering you) - if auto_tag: count tagged + failures
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_id | No | ||
| days | No | ||
| auto_tag | No | ||
| tag_name | No | auto_detected_spam | |
| account_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |