Skip to main content
Glama
ntk148v

alertmanager-mcp-server

post_silence

Create or update silences in Alertmanager to temporarily suppress notifications for specific alerts.

Instructions

Post a new silence or update an existing one

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
silenceYes

Implementation Reference

  • The main handler function for the 'post_silence' MCP tool. It is decorated with @mcp.tool, which also serves as registration. The function takes a silence dict and POSTs it to the Alertmanager API via make_request, returning the response.
    @mcp.tool(description="Post a new silence or update an existing one")
    async def post_silence(silence: Dict[str, Any]):
        """Post a new silence or update an existing one
    
        Parameters
        ----------
        silence : dict
            A dict representing the silence to be posted. This dict should
            contain the following keys:
                - matchers: list of matchers to match alerts to silence
                - startsAt: start time of the silence
                - endsAt: end time of the silence
                - createdBy: name of the user creating the silence
                - comment: comment for the silence
    
        Returns
        -------
        dict:
            Create / update silence response from Alertmanager API.
        """
        return make_request(method="POST", route="/api/v2/silences", json=silence)
  • The @mcp.tool decorator registers the post_silence function as an MCP tool.
    @mcp.tool(description="Post a new silence or update an existing one")
  • Docstring within the handler describes the expected input schema for the silence parameter.
    silence : dict
        A dict representing the silence to be posted. This dict should
        contain the following keys:
            - matchers: list of matchers to match alerts to silence
            - startsAt: start time of the silence
            - endsAt: end time of the silence
            - createdBy: name of the user creating the silence
            - comment: comment for the silence
    
    Returns
    -------
    dict:
        Create / update silence response from Alertmanager API.
    """

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ntk148v/alertmanager-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server