Update Alert Rule
update_alert_ruleReconfigure or toggle one alert rule, predefined or custom.
ref decides which: a kind name (consistent_error_pattern, swallowed_error,
tool_loop, context_rot) addresses the predefined rule of that kind; a uuid
addresses a custom rule. Get either from list_alert_rules.
Only what you pass changes. Turning a rule off stops detection, not just notification — gaps in history are permanent and nothing backfills them.
The two rule shapes take DIFFERENT settings, and mixing them is refused with a message naming the right one:
a predefined rule has named integer knobs -> pass
configa custom rule has metric thresholds -> pass
rules(+window_minutes)
ref: the rule's kind or uuid.
enabled: turn detection on or off.
rca_enabled: turn root-cause analysis on or off for this rule.
name: rename a custom rule (predefined rules take their name from their kind).
config: for a PREDEFINED rule only — its named knobs, e.g.
{"min_errored_spans": 10}. consistent_error_pattern takes
window_minutes, min_errored_spans, min_distinct_traces; swallowed_error
takes window_minutes, min_errored_spans. tool_loop takes window_minutes,
min_identical_calls (3-100000, identical calls in one run that make a
loop), exclude_retries (0 off, 1 on, the default: a call that errored ends
the loop and does not count, so a retry is not a loop) and polling_as_info
(0 off, 1 on, the default: a loop whose calls come at a near-regular
interval is written as an info finding, likely polling, and alerts nobody;
set 0 to alert on polling too) and session_scope (0 off, the default, 1
on: the runs of one session are read as one sequence, so the same call
repeated across consecutive runs of a session is a loop too; a run
boundary does not end the sequence, a pause of over five minutes does; the
finding lands on the run that completed the loop). context_rot takes
window_minutes plus:
max_context_usage_pct (1-100, how full the window may get),
critical_context_usage_pct (1-100, the critical level; the server requires
it to be at least max_context_usage_pct), max_tool_share_pct (1-100, the
share of the context one tool's results may take), sustain_calls (1-20,
how many LLM calls a condition must hold for), min_drop_pct (10-95, the
smallest fall in prompt size, in percent, that counts as a drop),
detect_history_loss, detect_cutoff and detect_thrashing (0 off, 1 on; true
and false are accepted), thrash_compactions (2-10, consecutive automatic
compactions that count as thrashing; a manual compaction breaks the chain)
and thrash_calls (1-50, the most LLM calls between two compactions for the
second to count as following the first). Call describe_alert_catalog for
the bounds.
rules: for a CUSTOM rule only — replace its thresholds. Replaces the whole
list, so pass window_minutes with it.
window_minutes: the window. For a custom rule it is part of the replaced
config, so pass rules too; for a predefined rule put it in config.
filters: for a CUSTOM rule only — replace its filters. Replaces the whole
list. Same shape and the same verbatim-value rule as create_alert_rule.
channel_ids: change where the rule delivers. Needs channels:manage. An empty
list does NOT silence the rule — it re-points it at the region's default
webhook. To stop notifications, set enabled to false.
workspace: optional workspace id, name, or org-name/workspace-name when the
same name occurs in two of your orgs (defaults to your default).
Example:
Turn off the tool loop alert.
{ "name": "update_alert_rule", "arguments": { "ref": "tool_loop", "enabled": false } }Example:
Alert me on polling loops too, and only after 5 identical calls.
{ "name": "update_alert_rule", "arguments": {
"ref": "tool_loop",
"config": { "polling_as_info": 0, "min_identical_calls": 5 }
} }Example:
Make the error pattern alert less noisy — 10 errors, not 3.
{ "name": "update_alert_rule", "arguments": {
"ref": "consistent_error_pattern",
"config": { "min_errored_spans": 10 }
} }Example:
Flag an agent that compacts three times in a row, within 5 calls of each other.
{ "name": "update_alert_rule", "arguments": {
"ref": "context_rot",
"config": { "detect_thrashing": 1, "thrash_compactions": 3, "thrash_calls": 5 }
} }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": {
"ref": "<ref>"
},
"name": "update_alert_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | ||
| name | No | ||
| rules | No | ||
| config | No | ||
| enabled | No | ||
| filters | No | ||
| workspace | No | ||
| channel_ids | No | ||
| rca_enabled | No | ||
| window_minutes | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |