Skip to main content
Glama

upsert_grafana_alert_rule

DestructiveIdempotent

Create or update a provisioned Grafana alert rule on the tenant's connection: POST /api/v1/provisioning/alert-rules when no uid, else PUT /api/v1/provisioning/alert-rules/{uid}. Required: rule (the alert-rule object). Optional: uid (update an existing rule).

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": {
      "rule": "<rule>"
    },
    "name": "upsert_grafana_alert_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
uidNoUID of an existing rule to update; omit to create
ruleYesGrafana alert-rule object

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / rule / description
      Added value: +"Grafana alert-rule object"
    • addedInput schema / properties / uid / description
      Added value: +"UID of an existing rule to update; omit to create"
  2. First observed

TDQS

A3.6/5.0
Behavior3/5

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

The description adds real behavioral detail beyond the annotations by explaining that this targets 'provisioned' rules on the tenant's connection and how the HTTP method selection works. However, despite destructiveHint=true and openWorldHint=true, it says nothing about what an update overwrites, whether omitted fields are cleared, or what permissions/existing provisioning state are required.

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 routing rule is front-loaded in the first clause and the required/optional summary is compact. Slight redundancy in re-explaining uid after the schema already does so, but nothing is wasted.

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

Completeness3/5

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

For a destructive, idempotent upsert taking a nested object and returning no documented output, the description covers routing but not overwrite semantics, required permissions, or the shape of the rule payload. It is adequate to start a call but not to call it safely.

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

Parameters3/5

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

Schema coverage is 100%, so both parameters are already documented, and the description largely restates them. It does add the consequence that uid selects the PUT path versus POST, but it contributes nothing about the nested 'rule' object's expected structure, which is the harder part for an agent to get right.

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?

The description gives a specific verb pair and resource ('Create or update a provisioned Grafana alert rule on the tenant's connection') and even names the REST endpoints used. This distinguishes it from list/delete alert-rule siblings by verb, though it never explicitly contrasts itself with them.

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?

It clearly routes between the two modes: POST with no uid, PUT with uid. That is genuine when-to-use guidance for the create-vs-update decision, but there are no exclusions or pointers to alternatives (e.g., deleting, or listing existing rules before updating).

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.