Skip to main content
Glama

list-all

List all Kubernetes resources in a namespace to view cluster contents and manage deployments, pods, and services efficiently.

Instructions

List all Kubernetes resources in a namespace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNoThe namespace to list all resources from (optional, defaults to current context namespace)

Implementation Reference

  • The handler function for the 'list-all' tool that executes 'kubectl get all -o wide' in the specified namespace to list all Kubernetes resources.
    case "list-all": {
      const { namespace } = args || {};
      const nsArg = namespace ? `-n ${namespace}` : "";
      const cmd = `kubectl get all ${nsArg} -o wide`;
      const { stdout } = await execAsync(cmd);
      return {
        content: [{ type: "text", text: stdout || "No resources found" }]
      };
    }
  • The tool metadata including name, description, and input schema definition for the 'list-all' tool, which is part of the tools array registered with the server.
    {
      name: "list-all",
      description: "List all Kubernetes resources in a namespace",
      inputSchema: {
        type: "object",
        properties: {
          namespace: { 
            type: "string",
            description: "The namespace to list all resources from (optional, defaults to current context namespace)"
          }
        }
      }
    },
  • server.js:1392-1394 (registration)
    The registration of the tools list handler, which includes the 'list-all' tool in the returned tools array.
    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