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 on the region's default webhook. 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}]
} }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
rulesYes
enabledNo
filtersNo
workspaceNo
channel_idsNo
window_minutesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnlyHint=false, destructiveHint=false), and the description adds substantial context beyond them: rules are ANDed with no OR, filters are ANDed, values bind verbatim (the lowercase `llm` gotcha), channel_ids requires the `channels:manage` capability, omitting channel_ids falls back to the region default webhook, and enabled defaults to true.

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?

Front-loaded purpose followed by per-parameter semantics and two worked examples; the structure is easy to scan. It is long, but nearly every line maps to an undocumented parameter or a non-obvious behavioral constraint, so little is wasted — the two examples are the only arguably expendable material.

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?

A 7-parameter mutation tool with 0% schema coverage is fully documented, and since an output schema exists the description is not obliged to explain return values. Nothing needed to invoke the tool 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 carries the full burden and does: name length bounds, rules element shape with the lt/lte/gt/gte/eq operator set plus the 1–10 count and (metric, aggregation) uniqueness constraint, window_minutes range, filter shape with eq/ne/in/not_in arity rules, channel_ids source, and workspace id/name/`org/workspace` formats.

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?

Opens with a specific verb+resource ("Create a custom alert rule") and immediately distinguishes this from predefined rules and from update_alert_rule. An agent can tell it apart from siblings like create_alert_channel or update_alert_rule without opening the 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?

Explicit prerequisites ("Call describe_alert_catalog first"), an explicit exclusion ("Predefined rules cannot be created"), and a named alternative ("Use update_alert_rule to configure one"). It also routes to list_alert_channels for channel_ids, so both the when and the where-next are covered.

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.

Resources