Skip to main content
Glama
ntk148v

alertmanager-mcp-server

get_alerts

Retrieve and filter active alerts from Alertmanager to monitor system notifications and manage incident responses.

Instructions

Get a list of alerts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNo
silencedNo
inhibitedNo
activeNo
countNo
offsetNo

Implementation Reference

  • The primary handler function for the 'get_alerts' MCP tool. Decorated with @mcp.tool(), it handles input parameters for filtering and pagination, validates params, fetches alerts from Alertmanager API (/api/v2/alerts), applies pagination, and returns structured results. This is the core implementation of the tool.
    @mcp.tool(description="Get a list of alerts")
    async def get_alerts(filter: Optional[str] = None,
                         silenced: Optional[bool] = None,
                         inhibited: Optional[bool] = None,
                         active: Optional[bool] = None,
                         count: int = DEFAULT_ALERT_PAGE,
                         offset: int = 0):
        """Get a list of alerts currently in Alertmanager.
    
        Params
        ------
        filter
            Filtering query (e.g. alertname=~'.*CPU.*')"),
        silenced
            If true, include silenced alerts.
        inhibited
            If true, include inhibited alerts.
        active
            If true, include active alerts.
        count
            Number of alerts to return per page (default: 10, max: 25).
        offset
            Number of alerts to skip before returning results (default: 0).
            To paginate through all results, make multiple calls with increasing
            offset values (e.g., offset=0, offset=10, offset=20, etc.).
    
        Returns
        -------
        dict
            A dictionary containing:
            - data: List of Alert objects for the current page
            - pagination: Metadata about pagination (total, offset, count, has_more)
              Use the 'has_more' flag to determine if additional pages are available.
        """
        # Validate pagination parameters
        count, offset, error = validate_pagination_params(
            count, offset, MAX_ALERT_PAGE)
        if error:
            return {"error": error}
    
        params = {"active": True}
        if filter:
            params = {"filter": filter}
        if silenced is not None:
            params["silenced"] = silenced
        if inhibited is not None:
            params["inhibited"] = inhibited
        if active is not None:
            params["active"] = active
    
        # Get all alerts from the API
        all_alerts = make_request(
            method="GET", route="/api/v2/alerts", params=params)
    
        # Apply pagination and return results
        return paginate_results(all_alerts, count, offset)
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states 'Get a list of alerts' without any details on permissions, rate limits, pagination (implied by 'count' and 'offset' parameters but not explained), or response format. This leaves critical behavioral traits like safety, performance, and output structure completely undocumented.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence, 'Get a list of alerts', which is front-loaded and wastes no words. However, this conciseness comes at the cost of under-specification, but per the scoring rules, it earns a high score for brevity and clarity within its limited scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of 6 parameters with 0% schema coverage, no annotations, no output schema, and multiple sibling tools, the description is severely incomplete. It doesn't explain what alerts are, how filtering works, what the return values include, or how to handle pagination, making it inadequate for effective tool use in this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning parameter titles like 'Filter', 'Silenced', and 'Active' lack explanations in the schema. The description provides no additional meaning for these 6 parameters, failing to compensate for the coverage gap. For example, it doesn't clarify what 'Filter' applies to or how 'Silenced' affects results, leaving parameters semantically opaque.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get a list of alerts' clearly states the verb ('Get') and resource ('alerts'), making the basic purpose understandable. However, it lacks specificity about what kind of alerts (e.g., monitoring, security) or scope (e.g., all, filtered), and doesn't differentiate from siblings like 'get_alert_groups' or 'post_alerts', leaving the agent to infer distinctions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention siblings like 'get_alert_groups' for grouped alerts or 'post_alerts' for creating alerts, nor does it specify contexts like retrieving active vs. silenced alerts. The agent must rely on tool names alone, which is insufficient for informed selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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