Skip to main content
Glama
driosalido
by driosalido

list_alerts

View all active alerts in the Karma Alert dashboard to monitor Kubernetes alert status and identify issues requiring attention.

Instructions

List all active alerts in Karma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `list_alerts` tool handler fetches alert data and formats it into a summary string.
    async def list_alerts() -> str:
        """List all active alerts in Karma"""
        data, error = await fetch_karma_alerts()
        if error:
            return error
    
        # Process alerts using utility functions
        total_alerts = 0
        alert_text = ""
    
        grids = data.get("grids", [])
        for grid in grids:
            for group in grid.get("alertGroups", []):
                alerts = group.get("alerts", [])
                total_alerts += len(alerts)
    
                for alert in alerts[:10]:  # Show max 10 alerts per group
                    metadata = extract_alert_metadata(group, alert)
    
                    alert_text += f"• {metadata['alertname']}\n"
                    alert_text += f"  Severity: {metadata['severity']}\n"
                    alert_text += f"  State: {metadata['state']}\n"
                    alert_text += f"  Namespace: {metadata['namespace']}\n\n"
    
        if total_alerts == 0:
            return "No active alerts"
    
        alert_text = f"Found {total_alerts} alerts:\n\n" + alert_text
        return alert_text

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