Skip to main content
Glama

set_alert_template

DestructiveIdempotent

Set or clear a monitor's alert message template, validating allowed variables and preserving other templates. Customize alert notifications with run-specific details.

Instructions

Requires an API key with the write scope or higher. Set or clear a single alert message template on a monitor. The template is validated for allowed variables before saving. Pass an empty string for template to reset that entry to the built-in default. All other existing templates are preserved (read-modify-write). Available variables: {check_name}, {event}, {status}, {cause}, {last_ping}, {schedule}, {incident_url}, {run_url}, {branch}, {commit}, {actor}, {failing_stage}, {duration}, {latency}, {status_code}, {url}, {last_step}, {step_count}, {run_duration}, {body}, {detail}, {title}. {failing_stage} is CI-only and provider-dependent: always populated on GitLab; on GitHub only if the repository webhook also subscribes to the workflow_job event; never on Jenkins, whose Notification Plugin payload carries no step detail. {body} is the triggering ping's own text (pings.body_excerpt) — it is how a 'blocked' or 'note' event's reason reaches the alert, and a custom template is the only way to control where in the message it appears. {title} is the title of the run the alert is about — the free-text body posted with that run's /start ping. Populated for 'fail' (when the failing ping's rid resolves to a titled /start) and for 'stalled'/'overrun' under the same run-identification rule as {last_step}; empty otherwise, including for any run with no title, which is every run until a caller starts posting one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesMonitor UUID.
causeNoOptional cause for a per-cause override (e.g. 'silence', 'overrun', 'never_started', 'stalled', 'runaway'). Omit or leave empty for an event-type-wide template.
templateYesTemplate text with {variable} placeholders. Empty string resets to the built-in default.
event_typeYesEvent type: 'down', 'recovery', 'fail', 'every-run', 'success', 'started', 'blocked', 'note'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already mark the tool as destructive and idempotent. The description adds crucial behavior beyond annotations: read-modify-write preservation of other templates, validation of allowed variables before saving, and the scope of the write effect. It also clearly states that passing an empty string resets to the built-in default, so an agent understands what gets changed and what does not.

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

Conciseness4/5

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

The description is dense but most sentences add necessary operational detail, especially the variable list and its caveats. It is front-loaded with the auth requirement and core purpose before moving into detailed variable semantics. Some length is justified by the unusual behavior of the variables.

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

Completeness4/5

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

For a tool with no output schema, the description covers the critical context: auth scope, side effects, preservation of other templates, validation, and variable usage. It could have briefly mentioned the response/return after saving, but the absence is minor because the agent can still invoke the tool confidently.

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?

The input schema already documents all parameters at 100% coverage. The description adds significant value by exhaustively listing allowed template variables and clarifying tricky semantics for {failing_stage}, {body}, and {title}. The per-cause override ('cause') is barely expanded beyond the schema, but the descriptive text compensates for the most ambiguous parameter: the template variable set.

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 uses a specific verb and resource: 'set or clear a single alert message template on a monitor.' It distinguishes itself from sibling get_alert_templates by describing a mutating operation while also clarifying the update model (read-modify-write, per-template preservation).

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?

The description gives clear use guidance: requires a write-scope API key, explains how to clear/reset a template with an empty string, and describes the per-cause override semantics. It does not explicitly state when not to use it or directly reference alternatives, but the operation is well-scoped enough that an agent can determine when it applies.

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