Detect traffic drops and spikes
detect_traffic_anomaliesScans daily Search Console trends against the same weekday in prior weeks to flag unusual traffic days without weekly false alarms, then compares the latest week with a typical one.
Instructions
Scans the daily trend for days that differ sharply from the same weekday in the preceding weeks, so the weekly rhythm does not trigger false alarms. Returns the unusual days with the expected value and how the latest week compares with a typical one. Use it for monitoring and as the first step when someone asks "did our traffic drop?".
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": "detect_traffic_anomalies"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | How many days of history to examine. At least 35 are needed to form a baseline. | |
| metric | No | Which metric to watch. | clicks |
| filters | No | Filters; a row must match all of them. Example: [{"dimension":"page","operator":"contains","expression":"/blog/"},{"dimension":"country","operator":"equals","expression":"usa"}]. Countries are ISO 3166-1 alpha-3 codes, devices are DESKTOP, MOBILE or TABLET, and the regex operators use RE2 syntax. | |
| end_date | No | Last day of the period, YYYY-MM-DD in Pacific Time, or "today" / "yesterday". Defaults to the latest day Google has complete data for, usually 3 to 4 days ago. A later date includes days that are still incomplete. | |
| site_url | No | Search Console property, for example "sc-domain:example.com" or "https://www.example.com/". A bare domain or any page URL on the site also works. Optional when GSC_SITE_URL is set or the account has exactly one property. | |
| search_type | No | Which Google surface: web (default), image, video, news (the News tab), discover or googleNews. | web |
| min_deviation_pct | No | Smallest deviation from the expected value, in percent, worth reporting. |