Skip to main content
Glama

save_alert_rule

Create or update an alert rule for the calling tenant in one call. WRITE: available to any authenticated user. Omit ruleId to create a new rule; supply ruleId to REPLACE an existing one.

UPDATE IS A WHOLE-OBJECT REPLACE, NOT A MERGE. Every field you leave out is cleared — omitting description sets it to null. To change one thing, fetch the rule with get_alert_rules and re-send its full spec with that one field altered. Two things are carved out and survive omission: status — ACTIVE/DISABLED is preserved; change it with set_alert_rule_status delivery — notifyOnResolve is preserved. Where a rule's alerts go is not held on the rule at all: routing lives in the notification gateway, so set it with set_notification_destinations, passing source "alerting" and the rule id as subject.

Re-validates exactly like preview_alert_rule: if the spec is invalid, nothing is persisted and problems[] is populated instead of rule — preview_alert_rule first to calibrate the threshold, then save once problems[] is empty there.

The rule still saves even when warnings[] is non-empty — warnings are advisory, never a reason to withhold saving, unlike problems[]. warnings[] currently carries one code, FIELD_NEVER_OBSERVED: a filter/groupBy field querysql couldn't resolve to a known column (so it silently falls back to reading it from the JSON catch-all) and that has never appeared in this customer's recent telemetry — almost always a typo'd field name, especially when preview_alert_rule also reported dataCoverage.status = NO_MATCHING_DATA. Fix the spelling and re-preview rather than treat it as a calibration problem.

Authors a single metric or anomaly rule (one measure over a rolling window). Compound multi-condition rules can't be created here — build those in the web editor.

METRIC RULE (structured) — watches one measure over a rolling time window: source: telemetry source (required): LOGS, SPANS, METRICS filter: optional QuerySQL boolean filter, e.g. service = 'my-svc' fn: catalog measure function, e.g. count, error_rate, p95, error_burn_rate arg: optional field the measure operates on, e.g. duration_ms for p95 params: optional named measure params, e.g. {"budget":"0.001"} (error_burn_rate) expression: optional free-form aggregate (used instead of fn) — a ratio/calculation, e.g. countIf(status_code = 'ERROR') * 100.0 / count() (this is exactly fn: error_rate; use fn instead unless you need a custom ratio — both already return 0-100, don't divide by 100 again) metricName/metricType: required only when source is METRICS unit: optional explicit display unit for the measure, e.g. BYTES or DURATION_MS — set it when the metric name doesn't self-describe its unit (OTel names like jvm.memory.used or http.server.request.duration carry no unit suffix); omit it to let the server infer the unit from the metric name or measure function windowMinutes: rolling window length in minutes (required) groupBy: optional list of fields to group the series by comparator: threshold comparator: GT, GTE, LT, LTE (required for static) warningThreshold: the warning-tier threshold the measure is compared against (required for static) warningConsecutiveWindows: consecutive breaching windows for the warning tier (default 1) criticalThreshold / criticalConsecutiveWindows: optional escalation tier

ANOMALY METRIC (structured) — flags a measure that deviates from its own historical baseline instead of a fixed threshold. Supply zScoreThreshold + direction instead of comparator/warningThreshold; groupBy must be empty. zScoreThreshold: robust z-score magnitude that counts as anomalous (> 0) direction: HIGH (spikes above baseline) or LOW (drops below baseline) anomalyConsecutiveWindows: consecutive anomalous windows required (>= 1)

Common fields: name: human-readable rule name (required, non-blank) description: optional free text notifyOnResolve: whether to notify when the alert resolves (default true) active: create-only — whether the rule starts ACTIVE (default true) or DISABLED

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fnNoCatalog measure function: count, error_rate, p95, error_burn_rate, ...
argNoOptional field the measure operates on, e.g. duration_ms
nameYesHuman-readable rule name (non-blank)
unitNoExplicit display unit for the measure, e.g. BYTES or DURATION_MS — set it when the metric name doesn't self-describe its unit (OTel names like jvm.memory.used or http.server.request.duration carry no unit suffix); omit to let the server infer the unit from the metric name or measure function
checkNoCompound AND/OR check tree as JSON, in the same shape get_alert_rules returns in checkDetails.check. Supply instead of the structured measurement and condition fields, which are ignored when this is set.
activeNoCreate-only: start the rule ACTIVE (default true) or DISABLED
filterNoOptional QuerySQL boolean filter, e.g. service = 'my-svc'
paramsNoOptional named measure params, e.g. {"budget":"0.001"}
ruleIdNoRule id (UUID) to update; omit to create a new rule
sourceNoTelemetry source: LOGS, SPANS, METRICS
groupByNoOptional fields to group the series by
directionNoAnomaly direction: HIGH or LOW
comparatorNoThreshold comparator: GT, GTE, LT, LTE (static rules)
expressionNoOptional free-form aggregate expression measuring the source, used instead of fn (takes precedence when set). QuerySQL over the source's fields, e.g. a ratio 'countIf(status_code = ''ERROR'') * 100.0 / count()' (this is exactly fn: error_rate, which already returns 0-100 — don't divide by 100 again) or a metric ratio 'avg(if(metric_name = ''a'', value, null)) / avg(if(metric_name = ''b'', value, null))'.
metricNameNoMetric name (required only when source is METRICS)
metricTypeNoMetric type: GAUGE, SUM, HISTOGRAM, ... (only when source is METRICS)
descriptionNoOptional free-text description
windowMinutesNoRolling window length in minutes
notifyOnResolveNoNotify when the alert resolves (default true)
zScoreThresholdNoAnomaly z-score threshold (> 0) — supply instead of comparator/warningThreshold
warningThresholdNoWarning-tier threshold (static rules)
criticalThresholdNoOptional critical-tier threshold (escalation)
anomalyConsecutiveWindowsNoConsecutive anomalous windows required (>= 1)
warningConsecutiveWindowsNoConsecutive breaching windows for the warning tier (default 1)
criticalConsecutiveWindowsNoConsecutive breaching windows for the critical tier (default 1)

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it exceeds that burden: it discloses WRITE access, whole-object replace semantics, fields preserved on omission, validation failure behavior with problems[], advisory warnings, and FIELD_NEVER_OBSERVED behavior. It also explains output shape expectations (rule vs. problems[]). This is far more behavioral detail than typical definitions provide and does not contradict any annotation.

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

Conciseness5/5

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

The description is long but justifiably so for a 25-parameter tool with two rule modes and destructive update semantics. It is front-loaded with the most safety-critical information (whole-object replace), then logically organized under METRIC RULE, ANOMALY METRIC, and Common fields. Every section earns its place and formatting is scannable.

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?

Given the tool's complexity and the absence of both annotations and an output schema, the description provides a remarkably complete picture. It covers authentication scope, validation workflow, return semantics (problems[] vs rule[]), warnings handling, and all mode-specific parameter groupings. An agent could reliably decide whether to use this tool and construct a correct call without opening additional documentation.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds substantial meaning beyond the schema: when metricName/metricType are required, zScoreThreshold+direction replace comparator/warningThreshold, groupBy must be empty for anomaly rules, sane defaults for windows and notifyOnResolve, and specific tips such as error_rate already returning 0-100. It also documents skip/omit behavior for fields like active on update. This materially helps an agent construct the correct payload.

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

Purpose5/5

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

The description states a precise verb plus resource: 'Create or update an alert rule for the calling tenant in one call.' It makes the create vs. replace distinction explicit through ruleId, and it also distinguishes the tool from related siblings such as set_alert_rule_status, set_notification_destinations, preview_alert_rule, and the web editor. This is far more than a tautology and leaves no ambiguity about what the tool does.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use and when-not-to-use guidance: preview_alert_rule first to calibrate, set_alert_rule_status for changing ACTIVE/DISABLED status, set_notification_destinations for delivery routing, and web editor for compound rules. It also warns about whole-object replacement, telling agents to fetch with get_alert_rules and re-send the full spec. This strongly routes the agent to the right alternative.

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.

TDQS

A3.8/5.0
Disambiguation2/5

Several tool pairs are near-duplicates, including three deprecated aliases (add_investigation_alert_channel vs add_alert_channel, list_investigation_alert_channels vs list_alert_channels, remove_investigation_alert_channel vs remove_alert_channel) that muddy the surface. Additionally, suppress_signal and create_ignore_rule both suppress alerting via different mechanisms, which could cause misselection despite detailed descriptions.

Naming Consistency4/5

The vast majority of tools follow a clear verb_noun snake_case pattern (create_api_test, list_issues, set_alert_rule_status). A few bare-noun tools (logs, spans, metrics) and the standalone verb correlate break the pattern slightly, but overall the naming is highly consistent and predictable.

Tool Count1/5

With 52 tools, this is on the extreme end of the calibration scale. Even accounting for the broad scope of an observability platform, the count is excessive and includes several deprecated redundancies that inflate it further.

Completeness5/5

The toolset provides comprehensive CRUD/lifecycle coverage across all major domains: alert rules (create, read, update, delete, status, delivery, preview), API tests (create, read, update, delete, run history, credentials), ignore rules and suppressions, issues with digest config, investigations with claim/read, channels, credentials, and rich query tools (logs, spans, metrics, SQL, traces, correlation). No obvious dead ends or missing core operations.

Resources