detect_anomalies
Identify days with abnormally high or low traffic using statistical z-score analysis across sites. Flags anomalies based on configurable thresholds to reveal unexpected traffic patterns.
Instructions
Find unusually high or low traffic days across sites using per-site z-score. For each site, computes the mean and stddev of daily visitors over the range, then flags any day where |z| ≥ threshold (default 2.5, ~1-in-100). Use for 'anything weird?', 'spikes this week', 'show me unusual traffic'. Pass site_id to scope to one site, otherwise scans the whole fleet. Returns most-recent anomalies first. Sites under 20 visitors total are skipped (not enough signal).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | No | Internal site UUID. Get one from list_sites. Omit to scope to the entire workspace. | |
| date_range | No | Time window. One of: today, yesterday, last_7_days, last_14_days, last_30_days, last_90_days. Defaults to last_14_days for stable mean/stddev. | |
| threshold | No | Z-score absolute value above which to flag a day as anomalous. Defaults to 2.5 (~1-in-100). Lower = more sensitive. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | ||
| threshold | Yes | ||
| sites_checked | Yes | ||
| anomalies | Yes |