get-configmap
Retrieve configuration data from a Kubernetes ConfigMap to access application settings and environment variables stored in the cluster.
Instructions
Get the data from a configmap
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"configmap": "<configmap>"
},
"name": "get-configmap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| configmap | Yes | The name of the configmap | |
| namespace | No | The namespace of the configmap (optional, defaults to current context namespace) |
Implementation Reference
- server.js:1742-1750 (handler)Handler implementation for the 'get-configmap' tool. Executes kubectl get configmap with -o yaml to retrieve the full configmap data including all keys and values.
case "get-configmap": { const { configmap, namespace } = args; const nsArg = namespace ? `-n ${namespace}` : ""; const cmd = `kubectl get configmap ${configmap} ${nsArg} -o yaml`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || "No configmap data found" }] }; } - server.js:566-582 (schema)Input schema definition for the 'get-configmap' tool, defining required 'configmap' name and optional 'namespace' parameter.
name: "get-configmap", description: "Get the data from a configmap", inputSchema: { type: "object", properties: { configmap: { type: "string", description: "The name of the configmap" }, namespace: { type: "string", description: "The namespace of the configmap (optional, defaults to current context namespace)" } }, required: ["configmap"] } }, - server.js:1392-1394 (registration)Registration handler for listing all available tools, including 'get-configmap' via the 'tools' array.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });