list_alert_rules
Retrieve and filter Grafana alert rules by labels to monitor their current state, UID, title, and labels for effective alert management.
Instructions
Lists Grafana alert rules, returning a summary including UID, title, current state, and labels
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": "list_alert_rules"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label_selectors | No | Label matchers to filter alert rules | |
| limit | No | Maximum number of results to return | |
| page | No | Page number to return |
Implementation Reference
- Helper method in GrafanaClient that performs the actual API call to list alert rules from Grafana's provisioning endpoint, used by the tool handler.
async listAlertRules(filters?: any): Promise<AlertRule[]> { try { const response = await this.client.get('/api/v1/provisioning/alert-rules', { params: filters, }); return response.data; } catch (error) { this.handleError(error); } }