Skip to main content
Glama

get_events

Retrieve Kubernetes events for a specified namespace using MCP Kubernetes Server, enabling simplified cluster management and monitoring through natural language commands.

Instructions

Get the events of a specific namespace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNodefault

Implementation Reference

  • The implementation of the 'get_events' tool handler. This async function is decorated with @mcp.tool(), which registers it as an MCP tool. It executes 'kubectl get events -n {namespace} -o json' to retrieve Kubernetes events for the given namespace and returns the JSON output or an error.
    @mcp.tool() async def get_events(namespace: str = "default") -> dict: """Get the events of a specific namespace""" try: cmd = ["kubectl", "get", "events", "-n", namespace, "-o", "json"] result = subprocess.run(cmd, capture_output=True, text=True, check=True) return json.loads(result.stdout) except subprocess.CalledProcessError as e: return {"error": f"Failed to get events: {str(e)}"}

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/abhijeetka/mcp-k8s-server'

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