Skip to main content
Glama

get-secret

Retrieve sensitive data from Kubernetes secrets to access configuration values, API keys, or credentials stored securely within your cluster.

Instructions

Get the data from a secret

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
secretYesThe name of the secret
namespaceNoThe namespace of the secret (optional, defaults to current context namespace)

Implementation Reference

  • The handler function for the 'get-secret' tool. It destructures the arguments to get the secret name and optional namespace, constructs a kubectl command to fetch the secret as YAML, executes it using execAsync, and returns the stdout content or a fallback message.
    case "get-secret": { const { secret, namespace } = args; const nsArg = namespace ? `-n ${namespace}` : ""; const cmd = `kubectl get secret ${secret} ${nsArg} -o yaml`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || "No secret data found" }] }; }
  • The schema definition for the 'get-secret' tool, including name, description, and input schema specifying the required 'secret' parameter and optional 'namespace'.
    { name: "get-secret", description: "Get the data from a secret", inputSchema: { type: "object", properties: { secret: { type: "string", description: "The name of the secret" }, namespace: { type: "string", description: "The namespace of the secret (optional, defaults to current context namespace)" } }, required: ["secret"] } },
  • server.js:1392-1394 (registration)
    The tool list registration handler that returns the 'tools' array, which includes the 'get-secret' tool definition, making it discoverable via the MCP listTools request.
    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