get_silence
Retrieve a specific silence by its ID from the alertmanager-mcp-server to manage and review alert suppression details efficiently.
Instructions
Get a silence by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| silence_id | Yes |
Implementation Reference
- The handler function for the 'get_silence' tool. It retrieves a specific silence by its ID from the Alertmanager API using a GET request to /api/v2/silences/{silence_id}. The function is decorated with @mcp.tool, registering it as an MCP tool.@mcp.tool(description="Get a silence by its ID") async def get_silence(silence_id: str): """Get a silence by its ID Parameters ---------- silence_id : str The ID of the silence to be retrieved. Returns ------- dict: The Silence object from Alertmanager instance. """ return make_request(method="GET", route=urljoin("/api/v2/silences/", silence_id))
- src/alertmanager_mcp_server/server.py:139-139 (registration)The @mcp.tool decorator registers the get_silence function as an MCP tool.@mcp.tool(description="Get a silence by its ID")