get-events
Retrieve Kubernetes events to identify and resolve cluster issues, enabling efficient troubleshooting of pods, deployments, and services.
Instructions
Get Kubernetes events for troubleshooting
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | The namespace to get events from (optional, defaults to current context namespace) |
Implementation Reference
- server.js:1600-1608 (handler)Executes the 'get-events' tool by running the kubectl get events command, optionally filtered by namespace, sorted by last timestamp, and returns the output as text content.case "get-events": { const { namespace } = args || {}; const nsArg = namespace ? `-n ${namespace}` : ""; const cmd = `kubectl get events ${nsArg} --sort-by='.lastTimestamp'`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || "No events found" }] }; }
- server.js:314-325 (schema)Defines the tool metadata including name, description, and input schema allowing an optional namespace parameter.name: "get-events", description: "Get Kubernetes events for troubleshooting", inputSchema: { type: "object", properties: { namespace: { type: "string", description: "The namespace to get events from (optional, defaults to current context namespace)" } } } },