Skip to main content
Glama
mshegolev

mshegolev/prometheus-mcp

prometheus_list_rules

Read-onlyIdempotent

List Prometheus recording and alerting rules with their PromQL expressions and current state. Use it to inspect alerting configuration or find pre-computed recording rules.

Instructions

List recording and alerting rules from Prometheus.

Wraps GET /api/v1/rules. Returns rule groups with their rules, including the PromQL expression, rule type (recording or alerting), and for alerting rules their current state (firing/pending/inactive).

Use this to understand the alerting configuration, find recording rules that pre-compute useful aggregations, and investigate which rules are currently firing or have health issues.

Examples: - Use when: "What alerting rules are configured?" → type='alert'; inspect rule names and expressions. - Use when: "Are there any recording rules I can use instead of computing aggregations from scratch?" → type='record'; look for rules matching your investigation. - Use when: "Why is this alert firing? What's its PromQL expression?" → call with no filter; find the alert by name; read its query. - Don't use when: You want to see which alerts are currently firing (call prometheus_list_alerts — shows active alerts with state and value, without the PromQL definition).

Returns: dict with type_filter / total_groups / total_rules / recording_count / alerting_count / groups (list of rule groups with name, file, rule_count, rules).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoOptional filter by rule type: 'alert' for alerting rules only, 'record' for recording rules only. Leave empty for both types.
instanceNoTarget instance name (omit for default instance)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupsYes
total_rulesYes
type_filterYes
total_groupsYes
alerting_countYes
recording_countYes
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds behavioral context beyond annotations by specifying it wraps a GET request and detailing the return structure (rule groups with rules, PromQL expressions, states). No contradiction with annotations.

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 well-structured with front-loaded single sentence stating purpose, followed by API wrap detail, then bullet examples and return dict summary. Every sentence adds value, and it's appropriately sized for the complexity.

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?

Given the tool's low complexity (2 optional parameters, output schema exists), the description fully covers purpose, usage, behavioral traits, and return structure. No gaps are apparent.

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 the schema already documents both parameters. The description adds some contextual value by explaining the purpose of the 'type' filter via examples, but does not add new syntactic or semantic meaning beyond what the schema provides. Baseline 3 is appropriate.

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 clearly states it lists recording and alerting rules from Prometheus, specifying the verb 'List' and resource 'rules'. It distinguishes from sibling tool 'prometheus_list_alerts' by noting that this tool shows rule definitions, not active alerts.

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?

The description provides explicit when-to-use examples (e.g., 'What alerting rules are configured?') and a 'Don't use when' with the alternative tool 'prometheus_list_alerts', giving clear guidance on when to use this tool vs alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mshegolev/prometheus-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server