Skip to main content
Glama

WatchFor

Create alert rule

create_alert_rule

Creates 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

NameRequiredDescriptionDefault
nameYesRule name
valueYesThreshold as a string, e.g. "2000", "14", or '["2xx","3xx"]' for status groups
metricYesExact metric string from the catalog
regionsNoNetwork-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.
operatorYesComparison operator: > < >= <= == != for numbers, in_groups/not_in_groups for status codes
severityNoIncident severitycritical
monitor_idYesMonitor id (UUID)
duration_windowNoSeconds 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_idNoContact group id this rule notifies, in addition to the monitor's own groups (null removes it on update)
failure_thresholdNoConsecutive failing checks before an incident opens
min_failed_probesNoLocations that must report the failure in the same evaluation (default 1)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations (readOnly=false, idempotent=false, destructive=false) by disclosing the duplicate-refusal behavior and conflict status code, that a refused duplicate leaves the existing rule unchanged, region-scoped vs all-regions precedence, and the full default-resolution chain for failure_threshold and durationWindow. It also explains the response's `warnings` field and what conditions make a saved rule unable to fire, which no structured field conveys.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action is front-loaded, but the rest is a single dense block riddled with nested parentheses and chained conditionals ("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 ... else the type's default"), which is hard to parse and would benefit from structure. Content is mostly valuable, so this is verbosity of form rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter mutation with no output schema, the description covers the risky edges: conflict handling, which parameters are mutually constrained (regions vs region_scoped metrics), default resolution when optional parameters are omitted, and even the semantic of the returned `warnings`. An agent can call this correctly without further probing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: `metric` must be the catalog's exact string also exposed as available_metrics, `value` is always a string, `regions` semantics and precedence, and the failure_threshold default cascade per metric type. Not all 11 parameters get extra explanation (name, operator, severity, contact_group_id, min_failed_probes rely on schema text), which keeps this at 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a precise verb+resource+"write scope" pairing ("Creates an alert rule on a monitor"), so an agent immediately knows this is the creation path for alert rules. It never names update_alert_rule or list_alert_rules as the alternative paths, so sibling differentiation is implied by the "create" framing rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives strong conditional guidance: at most one rule per metric/severity/region, duplicates refused with 409 and the existing rule untouched, regions only valid for region_scoped metrics (latency, packet loss, jitter) and refused on Offline. Withholding a point because there is no explicit routing guidance against sibling tools (e.g. when to update an existing rule instead of creating one).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.