Skip to main content
Glama

Create Alert Rule

create_alert_rule

Create a custom alert rule. Call describe_alert_catalog first.

The rule fires when every threshold in rules holds at once, over the same rolling window, for the traffic left after every filter in filters. There is no OR: for alternatives, create a second rule.

Predefined rules cannot be created — they already exist per workspace. Use update_alert_rule to configure one.

name: what to call the rule, 1 to 120 characters. rules: the thresholds, each {"metric":…, "aggregation":…, "operator":…, "value":…}. At least one, at most 10, and each (metric, aggregation) pair only once. Operators: lt, lte, gt, gte, eq. window_minutes: the rolling window every threshold is measured over, 5 to 1440. filters: optional narrowing, each {"field":…, "operator":…, "values":[…]}. ANDed. Omit to watch the whole workspace. eq and ne take exactly one value; in and not_in take one or more. Which operators a field admits is per field — describe_alert_catalog lists them. Values bind verbatim, so pass them exactly as the data spells them: span_kind is the raw OpenInference LLM, not llm, and a lowercased value creates a rule that saves and then never fires. channel_ids: where firings are delivered, from list_alert_channels. Supplying this needs the channels:manage capability, because choosing a destination is a destination decision. Omitting it leaves the rule with no destination: firings show in the console but nobody is notified, so add a webhook or email channel to get notified. enabled: whether detection starts immediately. Defaults to true. 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:

Alert me when the checkout agent starts erroring.

{ "name": "create_alert_rule", "arguments": {
    "name": "checkout errors",
    "filters": [{"field": "service", "operator": "eq", "values": ["checkout"]}],
    "rules": [{"metric": "errors", "aggregation": "count", "operator": "gte", "value": 5}]
} }

Example:

Tell me if p95 cost per trace goes over two dollars.

{ "name": "create_alert_rule", "arguments": {
    "name": "cost spike",
    "window_minutes": 60,
    "rules": [{"metric": "cost", "aggregation": "p95", "operator": "gt", "value": 2.0}]
} }

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": {
      "name": "<name>",
      "rules": "<rules>"
    },
    "name": "create_alert_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
rulesYes
enabledNo
filtersNo
workspaceNo
channel_idsNo
window_minutesNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations cover the mutation/safety profile (readOnly=false, destructive=false, idempotent=false), yet the description adds substantial context beyond them: the channels:manage capability requirement for channel_ids, the consequence of omitting a destination (firings visible but nobody notified), and that enabled=true starts detection immediately. It also discloses the AND-only firing semantics and the silent-failure trap of lowercased filter values.

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?

Front-loads the prerequisite, then the firing semantics (the surprising part), then per-parameter notes, then two worked examples mapping natural-language intent to arguments. Length is justified because schema coverage is 0%, so parameter detail cannot be delegated; no sentence is 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?

An output schema exists, so return values need not be explained, and everything else an agent needs for a 7-parameter mutation — prerequisites, capability gate, defaults, failure modes, worked examples — is present. Nothing required to call it correctly is missing.

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?

Schema description coverage is 0%, so the description must carry all parameter meaning and does: bounds on name (1–120) and window_minutes (5–1440), cardinality limits on rules (1–10, unique metric/aggregation pairs), the full operator vocabulary, the AND semantics of filters and per-operator value arity, and the workspace id/name/org-qualified forms. The verbatim value-binding warning for span_kind is the kind of semantics no schema could express.

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?

States a specific verb and resource ('Create a custom alert rule') and immediately delimits scope: predefined rules cannot be created and are configured via update_alert_rule. An agent can distinguish this from update_alert_rule, list_alert_rules, and delete_alert_rule without opening any schema.

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?

Gives explicit prerequisites ('Call describe_alert_catalog first', channel ids from list_alert_channels) and explicit exclusions ('Predefined rules cannot be created — use update_alert_rule to configure one'). It also handles the OR case by routing the agent to a second rule rather than improvising, and warns that omitting channel_ids yields a silent rule.

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.