prometheus_list_rules
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
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Optional filter by rule type: 'alert' for alerting rules only, 'record' for recording rules only. Leave empty for both types. | |
| instance | No | Target instance name (omit for default instance) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groups | Yes | ||
| total_rules | Yes | ||
| type_filter | Yes | ||
| total_groups | Yes | ||
| alerting_count | Yes | ||
| recording_count | Yes |