Loki: List Rules
loki_list_rulesList Loki ruler alerting and recording rules with health, last error, and firing state (firing first). Filter by type, state, or name, and optionally include each rule's LogQL expression.
Instructions
List the Loki ruler's alerting and recording rules (LogQL rules evaluated by Loki itself, not Prometheus or Grafana-managed alerts), with health, last error and, for alerts, whether they are firing — firing first. Answers an empty list when no rule groups exist for this tenant, and 404 when the ruler is not deployed or not routed.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "loki_list_rules"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Only alerting rules (alert) or only recording rules (record). | |
| state | No | Only alerting rules in this state. | |
| search | No | Case-insensitive substring to filter by, e.g. `api`. | |
| include_query | No | Include each rule's LogQL expression. Off by default: it is most of the size. |