Skip to main content
Glama
driosalido
by driosalido

list_clusters

Retrieve all available Kubernetes clusters from the Karma Alert dashboard to monitor and analyze alerts across your infrastructure.

Instructions

List all available Kubernetes clusters in Karma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'list_clusters' tool handler implementation. It fetches alert data, extracts cluster information, and returns a formatted string.
    async def list_clusters() -> str:
        """List all available Kubernetes clusters in Karma"""
        data, error = await fetch_karma_alerts()
        if error:
            return error
    
        clusters, cluster_alert_counts = extract_cluster_info(data)
    
        # Format output
        result = "🏢 Available Kubernetes Clusters\n"
        result += "=" * 50 + "\n\n"
    
        for cluster_name, info in sorted(clusters.items()):
            alert_count = cluster_alert_counts.get(cluster_name, 0)
            status_icon = "✅" if "healthy" in info["status"] else "❌"
    
            result += f"📋 {cluster_name}\n"
            result += f"   Instance: {info['instance_name']}\n"
            result += f"   Status: {status_icon} {info['status']}\n"
            result += f"   Alertmanager: {info['version']}\n"
            result += f"   Active Alerts: {alert_count}\n"
            result += f"   URI: {info['uri']}\n\n"
    
        result += "📊 Summary:\n"
        result += f"   Total Clusters: {len(clusters)}\n"
        result += f"   Total Alert Instances: {sum(cluster_alert_counts.values())}"
    
        return result

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