Skip to main content
Glama

list-namespaces

Retrieve all namespaces in a Kubernetes cluster to view available environments and organize resource management.

Instructions

List all Kubernetes namespaces

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'list-namespaces' tool: executes 'kubectl get namespaces -o wide' and returns the stdout 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" }] }; }
  • Tool definition including name, description, and empty input schema for 'list-namespaces'.
    name: "list-namespaces", description: "List all Kubernetes namespaces", inputSchema: { type: "object", properties: {} } },
  • server.js:1392-1394 (registration)
    Registration of all tools list via ListToolsRequestHandler, which returns the 'tools' array containing 'list-namespaces'.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });

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/thekaranpargaie/kube-mcp'

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