Skip to main content
Glama
mgcrea

mcp-prometheus

by mgcrea

Prometheus: List Rules

prometheus_list_rules
Read-only

Lists Prometheus alerting and recording rules with PromQL, health, and state; filter by health=err to catch failing rules before alerts silently stop firing.

Instructions

List alerting and recording rules with their PromQL, health and state. Use health=err to find rules that fail to evaluate (their lastError says why) — a broken alert rule never fires, which looks exactly like everything being fine. Use type=record to find a recording rule's name before querying it, since a precomputed series is far cheaper than recomputing it.

Input Schema

NameRequiredDescriptionDefault
typeNoOnly alerting or only recording rules. Defaults to any.any
groupNoOnly rules in this rule group, by exact name.
limitNoMaximum rules to return (1-1000). Defaults to 50.
stateNoOnly alerting rules in this state. Defaults to any.any
healthNoOnly rules with this evaluation health. err = the last evaluation failed.any
searchNoCase-insensitive substring matched against rule name, group and query, e.g. a metric name.
include_queryNoInclude each rule's PromQL. false roughly halves the size when only names are needed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

The readOnlyHint annotation already establishes that this is a safe read operation, and the description adds useful behavioral context: failed evaluations expose lastError, broken alert rules never fire, and precomputed recording series are cheaper than recomputation. It does not describe pagination or output shape, but the added operational insight is substantial.

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?

The description is three tightly structured sentences, front-loaded with the core action and followed by high-value usage notes. The explanatory clauses about broken alerts and precomputed series earn their place.

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 seven-parameter read-only list tool with no output schema, the description covers the core purpose and the two most operationally important filters. It leaves pagination, search, and group behavior to the schema, which is acceptable given full schema coverage but not fully comprehensive.

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 the baseline is 3. The description adds meaning beyond the schema for key filters: health=err points to failed evaluations and lastError, and type=record explains why recording rules are useful to locate before querying.

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 gives a specific verb and resource: lists alerting and recording rules, including PromQL, health, and state. It also distinguishes practical use cases from siblings, notably using type=record before querying a precomputed series.

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 explicitly explains when to use health=err to find broken rules and type=record to locate a recording rule before querying it. It does not explicitly contrast with prometheus_list_alerts or spell out when not to use this tool, so it falls short of full alternative routing.

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