list-configmaps
Retrieve Kubernetes ConfigMaps from a specified namespace to manage application configuration data and secrets within your cluster.
Instructions
List Kubernetes configmaps in a namespace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | The namespace to list configmaps from (optional, defaults to current context namespace) |
Implementation Reference
- server.js:1449-1457 (handler)The core handler logic for the 'list-configmaps' tool. It extracts the optional namespace from arguments, constructs a 'kubectl get configmaps' command, executes it via execAsync, and returns the stdout as text content.case "list-configmaps": { const { namespace } = args || {}; const nsArg = namespace ? `-n ${namespace}` : ""; const cmd = `kubectl get configmaps ${nsArg} -o wide`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || "No configmaps found" }] }; }
- server.js:77-88 (schema)The input schema definition for the 'list-configmaps' tool, defining the optional 'namespace' parameter.name: "list-configmaps", description: "List Kubernetes configmaps in a namespace", inputSchema: { type: "object", properties: { namespace: { type: "string", description: "The namespace to list configmaps from (optional, defaults to current context namespace)" } } } },
- server.js:1392-1394 (registration)The handler for ListToolsRequestSchema that returns the static 'tools' array containing the registration of 'list-configmaps' among other tools.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });