explain_anomaly
Explain a cost spike or dip on a given day versus a trailing baseline, returning the actual cost, baseline average, and services that drove the biggest difference.
Instructions
Explain a cost spike/dip on a given day vs. a trailing baseline.
Args:
day: ISO date to explain, e.g. "2025-08-25".
baseline_window_days: How many days before `day` to average as
the baseline (1-60). Defaults to 14.
threshold_pct: Percent deviation from baseline above which the
day is flagged `is_anomaly=True`. Defaults to 30%.
Returns the day's actual cost, the baseline average, and the
services that contributed most to the difference.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"day": "<day>"
},
"name": "explain_anomaly"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| day | Yes | ||
| threshold_pct | No | ||
| baseline_window_days | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ||
| delta | Yes | ||
| currency | Yes | ||
| delta_pct | Yes | ||
| is_anomaly | Yes | True if delta exceeds the anomaly threshold | |
| actual_cost | Yes | ||
| contributors | Yes | ||
| baseline_cost | Yes | ||
| baseline_window_days | Yes |