Skip to main content
Glama
driosalido
by driosalido

list_alerts_by_cluster

Retrieve Kubernetes alerts for a specific cluster from the Karma dashboard to monitor and analyze issues affecting that environment.

Instructions

List alerts filtered by specific cluster

Args: cluster_name: Name of the cluster to filter by (e.g., 'teddy-prod', 'edge-prod')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `list_alerts_by_cluster` tool implementation that fetches alerts, filters them by cluster using a helper function, and formats the result.
    async def list_alerts_by_cluster(cluster_name: str) -> str:
        """List alerts filtered by specific cluster
    
        Args:
            cluster_name: Name of the cluster to filter by (e.g., 'teddy-prod', 'edge-prod')
        """
        data, error = await fetch_karma_alerts()
        if error:
            return error
    
        # Use utility function to filter by cluster
        filtered_data = filter_alerts_by_cluster(data, cluster_name)
    
        # Count filtered alerts
        total_alerts = 0
        grids = filtered_data.get("grids", [])
        for grid in grids:
            for group in grid.get("alertGroups", []):
                total_alerts += len(group.get("alerts", []))
    
        if total_alerts == 0:
            return f"No alerts found for cluster: {cluster_name}"
    
        # Format output using utility functions
        result = f"🏢 Alerts in cluster '{cluster_name}'\n"
        result += "=" * 50 + "\n\n"
        result += f"Found {total_alerts} alerts:\n\n"
    
        counter = 1
        for grid in grids:
            for group in grid.get("alertGroups", []):
                for alert in group.get("alerts", []):
                    metadata = extract_alert_metadata(group, alert)
    
                    result += f"{counter:2d}. {metadata['alertname']}\n"
                    result += f"    Severity: {metadata['severity']}\n"
                    result += f"    State: {metadata['state']}\n"
                    result += f"    Namespace: {metadata['namespace']}\n"
                    result += f"    Cluster: {metadata['cluster']}\n"
    
                    # Add instance if available
                    instance = extract_label_value(alert.get("labels", []), "instance")
                    if instance != "unknown":
                        result += f"    Instance: {instance}\n"
    
                    result += "\n"
                    counter += 1
    
        return result
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 alerts filtered by cluster, but doesn't describe what 'alerts' entail, whether this is a read-only operation, if it requires authentication, any rate limits, pagination behavior, or what the output looks like. For a tool with no annotations, this leaves significant gaps in understanding its 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 appropriately sized and front-loaded, with the core purpose stated first ('List alerts filtered by specific cluster'), followed by parameter details in a structured 'Args:' section. Both sentences earn their place by clarifying the tool's function and parameter usage, with no redundant information.

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 has an output schema (which handles return values) and a simple input schema with one parameter, the description is minimally adequate. However, with no annotations and multiple sibling tools, it lacks context on behavioral traits, usage distinctions, and broader system integration. The description covers the basics but doesn't provide enough guidance for optimal tool selection in a crowded namespace.

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

Parameters4/5

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

The description adds meaningful semantics beyond the input schema. The schema has 0% description coverage, with only a title 'Cluster Name' and type 'string'. The description provides a clear explanation: 'Name of the cluster to filter by (e.g., 'teddy-prod', 'edge-prod')', including purpose and examples, which compensates well for the low schema coverage. However, it doesn't detail constraints like allowed values or format.

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 alerts filtered by specific cluster.' It includes a specific verb ('List') and resource ('alerts'), and specifies the filtering mechanism ('by specific cluster'). However, it doesn't explicitly differentiate from siblings like 'list_alerts' or 'list_active_alerts' beyond the cluster filtering, which is implied but not directly contrasted.

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. With siblings like 'list_alerts', 'list_active_alerts', 'get_alerts_by_state', and 'search_alerts_by_container', there's no indication of when cluster filtering is preferred over other filtering methods or what distinguishes this tool from similar ones. Usage is implied by the parameter but not explicitly stated.

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