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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get-events"
}
}Input 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)" } } } },