get_alert_groups
Retrieve a list of alert groups based on their status, including silenced, inhibited, or active, for efficient monitoring and management in alertmanager-mcp-server.
Instructions
Get a list of alert groups
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| active | No | ||
| inhibited | No | ||
| silenced | No |
Implementation Reference
- The handler function for the 'get_alert_groups' tool. It constructs query parameters based on optional silenced, inhibited, and active flags (defaulting active to True), then calls make_request to GET /api/v2/alerts/groups from the Alertmanager API.@mcp.tool(description="Get a list of alert groups") async def get_alert_groups(silenced: Optional[bool] = None, inhibited: Optional[bool] = None, active: Optional[bool] = None): """Get a list of alert groups Params ------ silenced If true, include silenced alerts. inhibited If true, include inhibited alerts. active If true, include active alerts. Returns ------- list Return a list of AlertGroup objects from Alertmanager instance. """ params = {"active": True} if silenced is not None: params["silenced"] = silenced if inhibited is not None: params["inhibited"] = inhibited if active is not None: params["active"] = active return make_request(method="GET", route="/api/v2/alerts/groups", params=params)