grafana/mcp-grafana

Feature Request: Add update_alert_group tool (acknowledge, resolve, update state)

Open

#813 建立於 2026年4月29日

在 GitHub 查看
 (0 留言) (1 反應) (0 負責人)Go (368 fork)auto 404
good first issuehelp wanted

倉庫指標

Star
 (3,078 star)
PR 合併指標
 (平均合併 2天 3小時) (30 天內合併 37 個 PR)

描述

Summary

The current OnCall toolset only has `list_alert_groups` and `get_alert_group`. There are no write tools to act on an alert group — making it impossible for an AI agent to close the loop on an alert without switching to the Grafana UI.

Motivation

In an AI-driven on-call workflow, the full lifecycle of an alert group is:

  1. Detect → `list_alert_groups` / `get_alert_group` ✅ (exists)
  2. Acknowledge → signal investigation started ❌ missing
  3. Resolve → close out once fix is confirmed ❌ missing

Without these, an agent using the MCP can investigate and triage but cannot update the alert state — defeating the purpose of agentic on-call automation. This mirrors the same gap I raised for incidents in #748.

Dependency

The underlying Go client (`grafana/amixr-api-go-client`) also lacks these methods, so this request spans two layers:

  1. `amixr-api-go-client`: add `AcknowledgeAlertGroup`, `UnacknowledgeAlertGroup`, `ResolveAlertGroup`, `UnresolveAlertGroup` methods
  2. `mcp-grafana`: add a single `update_alert_group` tool in `tools/oncall.go`

Proposed Tool

type UpdateAlertGroupParams struct {
    AlertGroupID string \`json:"alertGroupId" jsonschema:"required,description=The ID of the alert group to update"\`
    State        string \`json:"state" jsonschema:"required,description=New state for the alert group. One of: acknowledged\\, unacknowledged\\, resolved\\, unresolved"\`
}

Should be gated behind `enableWriteTools` (same as `create_incident`).

Use Cases

  • AI agent acknowledges an alert group immediately upon starting triage (signals to the team that it's being handled)
  • AI agent resolves the alert group after confirming the root cause is fixed and the PR is merged

Related

  • #748 — same pattern for Grafana Incidents
  • `tools/oncall.go` — where the new tool would live
  • `grafana/amixr-api-go-client` — Go client needs the write methods added first

貢獻者指南