list-deployments
List Kubernetes deployments in a specified namespace to monitor and manage application resources within your cluster.
Instructions
List Kubernetes deployments in a namespace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | The namespace to list deployments from (optional, defaults to current context namespace) |
Implementation Reference
- server.js:1423-1431 (handler)Handler for the 'list-deployments' tool. Executes 'kubectl get deployments [namespace] -o wide' and returns the output as text content.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" }] }; }
- server.js:47-58 (schema)Tool schema definition including name, description, and inputSchema for validating arguments (namespace optional). This object is part of the tools array used for tool listing.{ 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 tool list handler which returns the full tools array including 'list-deployments'.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });