Skip to main content
Glama
driosalido
by driosalido

delete_silence

Remove or expire an existing alert silence in Kubernetes clusters to restore monitoring for specific alerts.

Instructions

Delete (expire) an existing silence

Args: silence_id: ID of the silence to delete cluster: Cluster where the silence exists

Returns: Deletion result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
silence_idYes
clusterYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function 'delete_silence' implements the tool logic to verify existence and prepare a deletion request for a silence in a specified cluster.
    async def delete_silence(silence_id: str, cluster: str) -> str:
        """Delete (expire) an existing silence
    
        Args:
            silence_id: ID of the silence to delete
            cluster: Cluster where the silence exists
    
        Returns:
            Deletion result
        """
        try:
            # First verify the silence exists
            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:
                    return (
                        f"Error fetching silence information: code {response.status_code}"
                    )
    
                data = response.json()
                silences = data.get("silences", {}).get(cluster, {})
    
                if silence_id not in silences:
                    # Try to find with partial match
                    found = False
                    for sid in silences:
                        if silence_id in sid:
                            silence_id = sid
                            found = True
                            break
    
                    if not found:
                        return f"Silence ID {silence_id} not found in cluster {cluster}"
    
                silence_info = silences.get(silence_id, {})
    
                return f"""
    āš ļø Silence Deletion Request:
    
    šŸ”• Silence ID: {silence_id}
    šŸ“ Cluster: {cluster}
    šŸ’¬ Original comment: {silence_info.get("comment", "N/A")}
    šŸ‘¤ Created by: {silence_info.get("createdBy", "unknown")}
    
    Note: Direct Alertmanager API integration is required to complete this deletion.
    To manually delete this silence, use the Karma UI or Alertmanager API directly.
    """
    
        except Exception as e:
            return f"Error deleting silence: {str(e)}"
  • The Pydantic model 'DeleteSilenceRequest' defines the input schema for the delete_silence tool.
    class DeleteSilenceRequest(BaseModel):
        silence_id: str
        cluster: str
  • The route for deleting silences is registered as a DELETE endpoint on '/silences' in the FastAPI app.
    "DELETE /silences - Delete an existing silence",
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 deletes/expires a silence, implying a destructive mutation, but lacks details on permissions required, whether the action is reversible, rate limits, or error handling. The phrase 'expire' hints at a time-based aspect, but this isn't elaborated, leaving behavioral traits unclear.

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 appropriately sized and front-loaded, starting with the core action. The 'Args' and 'Returns' sections are structured clearly, but the 'Returns' line ('Deletion result') is vague and could be more informative. Overall, it avoids unnecessary verbosity, though minor improvements in specificity could enhance efficiency.

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 the tool's complexity (a destructive operation with 2 parameters, no annotations, but an output schema exists), the description is partially complete. It covers the basic purpose and parameters but lacks usage guidelines, detailed behavioral context, and specifics on the return value despite the output schema. The presence of an output schema reduces the need to explain returns, but other gaps remain significant.

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?

Schema description coverage is 0%, so the description must compensate. It lists both parameters ('silence_id' and 'cluster') and briefly explains their roles ('ID of the silence to delete' and 'Cluster where the silence exists'), adding meaning beyond the bare schema. However, it doesn't provide format details, examples, or constraints, leaving some semantic gaps for a tool with two required parameters.

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 action ('Delete/expire') and resource ('an existing silence'), making the purpose immediately understandable. It distinguishes itself from siblings like 'create_silence' and 'list_silences' by focusing on removal rather than creation or listing. However, it doesn't explicitly contrast with all siblings, such as whether it differs from other deletion-like operations if they existed.

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 no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing silence ID), exclusions, or comparisons to sibling tools like 'create_silence' or 'list_silences'. Without such context, an agent might struggle to determine the appropriate scenario for invoking this tool.

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