Skip to main content
Glama

list-secrets

Retrieve and display Kubernetes secrets within a specified namespace to manage sensitive configuration data like passwords and API keys.

Instructions

List Kubernetes secrets in a namespace

Input Schema

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

Implementation Reference

  • The execution handler for the 'list-secrets' tool. It extracts the optional namespace from arguments, constructs a 'kubectl get secrets' command, executes it via execAsync, and returns the stdout as text content or a default message if no output.
    case "list-secrets": {
      const { namespace } = args || {};
      const nsArg = namespace ? `-n ${namespace}` : "";
      const cmd = `kubectl get secrets ${nsArg} -o wide`;
      const { stdout } = await execAsync(cmd);
      return {
        content: [{ type: "text", text: stdout || "No secrets found" }]
      };
    }
  • The schema definition for the 'list-secrets' tool, including name, description, and input schema specifying an optional 'namespace' string parameter.
    name: "list-secrets",
    description: "List Kubernetes secrets in a namespace",
    inputSchema: {
      type: "object",
      properties: {
        namespace: { 
          type: "string",
          description: "The namespace to list secrets from (optional, defaults to current context namespace)"
        }
      }
    }
  • server.js:1392-1394 (registration)
    The request handler for listing tools, which returns the 'tools' array containing the 'list-secrets' tool registration.
    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