Skip to main content
Glama
mgcrea

@mgcrea/mcp-grafana

by mgcrea

Grafana: List Alert Rules

grafana_list_alert_rules
Read-only

Lists alert and recording rules with their state, health, labels, and group across Grafana-managed and Prometheus/Loki sources; filter by source, group, state, or failed evaluations.

Instructions

The alert rules and their evaluation state, from Grafana-managed alerting and from every Prometheus/Loki datasource that evaluates its own rules. Firing first, then pending. Each rule has its group, state, health (and lastError when it fails to evaluate), its for and labels; include_query adds the expression. Recording rules are left out unless type=record or all. Use grafana_list_alerts for the alert instances themselves.

Input Schema

NameRequiredDescriptionDefault
typeNoalert (default), record (recording rules), or all.alert
groupNoOnly this rule group (or folder), substring, e.g. "kubernetes-apps".
limitNoMaximum rules (1-2000). Defaults to 100.
stateNoOnly rules in this state. Defaults to any.any
searchNoCase-insensitive substring to filter by, e.g. `nginx`.
sourceNoOnly this source: "grafana" for Grafana-managed alerting, or a Prometheus/Loki datasource uid or name. Defaults to every source.
unhealthyNoOnly rules whose evaluation fails (health err / nodata).
include_queryNoAdd each rule's expression. Off by default: it is most of the size.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only declare readOnly and openWorld; the description adds real behavioral detail beyond them: result ordering ('Firing first, then pending'), per-rule fields returned including lastError on evaluation failure, and the cost caveat that include_query 'is most of the size'. It does not mention pagination/truncation, but the limit parameter covers that.

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?

Four tight sentences, no filler, with the source scope and ordering constraint front-loaded and the redirect to the sibling tool placed last where it belongs. The opening sentence is slightly dense but every clause carries information.

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 an 8-param, no-output-schema listing tool, the description carries the return-value burden well by enumerating what each rule contains. Only minor gaps: nothing about result ordering guarantees under filtering or what a truncated (limit-capped) result looks like.

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?

Schema coverage is 100%, so baseline would be 3, but the description adds meaning the schema lacks: it ties include_query to payload-size cost and clarifies the alert/record interaction of the type parameter. group/folder and unhealthy semantics remain schema-only.

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+resource ('The alert rules and their evaluation state') and explicitly scopes the source set to Grafana-managed alerting plus every self-evaluating Prometheus/Loki datasource. It is clearly distinguishable from grafana_list_alerts, which is named as covering alert instances rather than rules.

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?

Explicitly routes the agent: 'Use grafana_list_alerts for the alert instances themselves' and states that recording rules are excluded 'unless type=record or all'. That gives both a when-not and an override condition, though other overlapping siblings (search, silences) are not addressed.

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