Skip to main content
Glama

list-deployments

Retrieve Kubernetes deployments from a specified namespace to monitor and manage application resources in your cluster.

Instructions

List Kubernetes deployments in a namespace

Input Schema

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

Implementation Reference

  • Handler implementation for the 'list-deployments' tool. Executes 'kubectl get deployments' command with optional namespace flag and returns the stdout output.
    case "list-deployments": {
      const { namespace } = args || {};
      const nsArg = namespace ? `-n ${namespace}` : "";
      const cmd = `kubectl get deployments ${nsArg} -o wide`;
      const { stdout } = await execAsync(cmd);
      return {
        content: [{ type: "text", text: stdout || "No deployments found" }]
      };
    }
  • Tool schema definition including name, description, and inputSchema for 'list-deployments' used in tool registration.
    {
      name: "list-deployments", 
      description: "List Kubernetes deployments in a namespace",
      inputSchema: {
        type: "object",
        properties: {
          namespace: { 
            type: "string",
            description: "The namespace to list deployments from (optional, defaults to current context namespace)"
          }
        }
      }
  • server.js:1392-1394 (registration)
    Registration of the ListToolsRequestHandler which returns the tools array containing 'list-deployments'.
    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