Create alert rule
create_alert_ruleCreates an alert rule on a monitor (write scope). metric is one of the monitor type's alert metrics (the catalog's exact strings, also listed in the monitor's available_metrics); value is always a string. At most one rule per metric per severity per region scope: a duplicate is refused (409) and the existing rule stays as it is. Network-distance rules (metrics marked region_scoped: true in the catalog: latency, packet loss, jitter): regions limits the rule to checks from those regions (e.g. a latency threshold for Europe only); Offline and every other rule are judged from every region and refuse regions; a region-scoped rule takes precedence over an all-regions one of the same metric and severity. failure_threshold omitted: the monitor's confirmationThreshold when it has one, else the count the dashboard's Alerting tab gives the rule: 3 on a region-scoped metric, a card's own count where it has one (Domain Expiry, certificate expiry, RBL listing: 1), else the type's default (3 on most types) (durationWindow likewise follows the monitor's). The response's warnings (empty when fine) says when the saved rule can never fire as the monitor is set up: a region it isn't checked from, or a metric only measured with a setting that is off (e.g. packet loss with packetLoss off).
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": {
"monitor_id": "<monitor_id>",
"name": "<name>",
"metric": "<metric>",
"operator": "<operator>",
"value": "<value>"
},
"name": "create_alert_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Rule name | |
| value | Yes | Threshold as a string, e.g. "2000", "14", or '["2xx","3xx"]' for status groups | |
| metric | Yes | Exact metric string from the catalog | |
| regions | No | Network-distance rules only (region_scoped: true): region slugs the rule is judged from (europe, north-america, south-america, asia, middle-east, africa, oceania). Omitted = all regions. Refused on Offline and every other rule. | |
| operator | Yes | Comparison operator: > < >= <= == != for numbers, in_groups/not_in_groups for status codes | |
| severity | No | Incident severity | critical |
| monitor_id | Yes | Monitor id (UUID) | |
| duration_window | No | Seconds the condition must hold before the rule fires (0 = fire on the confirmed failure; omitted: the monitor's own setting on create, unchanged on update) | |
| contact_group_id | No | Contact group id this rule notifies, in addition to the monitor's own groups (null removes it on update) | |
| failure_threshold | No | Consecutive failing checks before an incident opens | |
| min_failed_probes | No | Locations that must report the failure in the same evaluation (default 1) |