Skip to main content
Glama
driosalido
by driosalido

list_silences

View active alert silences across Kubernetes clusters or filter by specific cluster to manage notification suppression in Karma Alert dashboard.

Instructions

List all active silences across clusters or for a specific cluster

Args: cluster: Optional cluster name to filter silences (e.g., 'teddy-prod')

Returns: Formatted list of active silences with details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clusterNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `list_silences` tool implementation which fetches silences from the Karma API, optionally filters by cluster, and formats the output.
    async def list_silences(cluster: str = "") -> str:
        """List all active silences across clusters or for a specific cluster
    
        Args:
            cluster: Optional cluster name to filter silences (e.g., 'teddy-prod')
    
        Returns:
            Formatted list of active silences with details
        """
        try:
            async with httpx.AsyncClient() as client:
                response = await client.post(
                    f"{KARMA_URL}/alerts.json",
                    json={},
                    headers={"Content-Type": "application/json"},
                    timeout=10.0,
                )
    
                if response.status_code == 200:
                    data = response.json()
                    silences = data.get("silences", {})
    
                    if not silences:
                        return "No active silences found"
    
                    # Filter by cluster if specified
                    if cluster:
                        cluster_lower = cluster.lower()
                        filtered_silences = {}
                        for cluster_name, cluster_silences in silences.items():
                            if cluster_lower in cluster_name.lower():
                                filtered_silences[cluster_name] = cluster_silences
                        silences = filtered_silences
    
                        if not silences:
                            return f"No active silences found for cluster: {cluster}"
    
                    # Format output
                    result = f"Active Silences{f' in {cluster}' if cluster else ''}\n"
                    result += "=" * 50 + "\n\n"
    
                    total_count = 0
                    for cluster_name, cluster_silences in silences.items():
                        if cluster_silences:
                            result += f"šŸ“ Cluster: {cluster_name}\n"
                            result += f"   Silences: {len(cluster_silences)}\n\n"
    
                            for silence_id, silence in list(cluster_silences.items())[
                                :5
                            ]:  # Limit to 5 per cluster
                                total_count += 1
                                result += f"  šŸ”• Silence ID: {silence_id[:8]}...\n"
                                result += f"     Created by: {silence.get('createdBy', 'unknown')}\n"
                                result += f"     Comment: {silence.get('comment', 'No comment')}\n"
                                result += (
                                    f"     Starts: {silence.get('startsAt', 'unknown')}\n"
                                )
                                result += f"     Ends: {silence.get('endsAt', 'unknown')}\n"
    
                                # Show matchers
                                matchers = silence.get("matchers", [])
                                if matchers:
                                    result += "     Matchers:\n"
                                    for matcher in matchers[:3]:  # Show first 3 matchers
                                        name = matcher.get("name", "")
                                        value = matcher.get("value", "")
                                        if len(value) > 50:
                                            value = value[:47] + "..."
                                        result += f"       - {name}: {value}\n"
                                result += "\n"
    
                            if len(cluster_silences) > 5:
                                result += f"   ... and {len(cluster_silences) - 5} more silences\n\n"
    
                    result += f"\nšŸ“Š Total: {total_count} active silence{'s' if total_count != 1 else ''}"
                    return result
                else:
                    return f"Error fetching silences: code {response.status_code}"
    
        except Exception as e:
            return f"Error connecting to Karma: {str(e)}"
Behavior2/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 states the tool lists 'active silences' and returns a 'formatted list', but lacks details on permissions required, rate limits, pagination, or error handling. For a tool with no annotations, this leaves significant gaps in understanding its operational behavior.

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

Conciseness4/5

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

The description is well-structured and concise, with a clear purpose statement followed by 'Args' and 'Returns' sections. Each sentence adds value, and there is no redundant information. It could be slightly improved by integrating the sections more seamlessly, but overall it's efficient.

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

Completeness3/5

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

Given that there is an output schema (which handles return values), no annotations, and low schema description coverage, the description is moderately complete. It covers the basic purpose and parameter usage but lacks behavioral details and usage guidelines relative to siblings. For a tool with one parameter and an output schema, it meets minimum viability but has clear gaps.

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

Parameters3/5

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

The description adds some semantic context for the 'cluster' parameter, explaining it as 'Optional cluster name to filter silences' with an example ('teddy-prod'), which is helpful since schema description coverage is 0%. However, it does not fully compensate for the lack of schema descriptions, as it doesn't detail format constraints or validation rules beyond the example.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'List all active silences across clusters or for a specific cluster.' It specifies the verb ('List'), resource ('active silences'), and scope ('across clusters or for a specific cluster'), which is clear and actionable. However, it does not explicitly differentiate from sibling tools like 'list_suppressed_alerts' or 'list_alerts', which might have overlapping functionality.

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?

The description provides minimal guidance on when to use this tool. It mentions the optional 'cluster' parameter for filtering, but does not specify when to use this tool versus alternatives like 'list_suppressed_alerts' or 'list_alerts_by_cluster'. No explicit when-not-to-use scenarios or prerequisites are mentioned, leaving the agent to infer usage from context.

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/driosalido/mcp-karma'

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