Skip to main content
Glama

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
NameRequiredDescriptionDefault
namespaceNoThe namespace to list configmaps from (optional, defaults to current context namespace)

Implementation Reference

  • 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" }]
      };
    }
  • 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 };
    });

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