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
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | The namespace to list secrets from (optional, defaults to current context namespace) |
Implementation Reference
- server.js:1459-1467 (handler)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" }] }; }
- server.js:90-100 (schema)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 }; });