list-namespaces
Lists all Kubernetes namespaces to help users identify and manage cluster resources through AI assistants.
Instructions
List all Kubernetes namespaces
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:1433-1439 (handler)The handler function for the 'list-namespaces' tool within the CallToolRequestSchema handler. It executes the kubectl command to list all namespaces and returns the output as text content.case "list-namespaces": { const cmd = `kubectl get namespaces -o wide`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || "No namespaces found" }] }; }
- server.js:60-67 (schema)The schema definition for the 'list-namespaces' tool in the tools array, specifying name, description, and empty input schema (no parameters required).{ name: "list-namespaces", description: "List all Kubernetes namespaces", inputSchema: { type: "object", properties: {} } },
- server.js:1392-1394 (registration)Registration of the ListToolsRequestSchema handler that returns the full list of tools, including 'list-namespaces'.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });