Skip to main content
Glama

list-serviceaccounts

Lists Kubernetes service accounts in a specified namespace to manage cluster access and permissions. Use this tool to view and audit service accounts for security and operational purposes.

Instructions

List Kubernetes service accounts in a namespace

Input Schema

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

Implementation Reference

  • Handler for list-serviceaccounts tool: runs 'kubectl get serviceaccounts [namespace] -o wide' and returns the output.
    case "list-serviceaccounts": { const { namespace } = args || {}; const nsArg = namespace ? `-n ${namespace}` : ""; const cmd = `kubectl get serviceaccounts ${nsArg} -o wide`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || "No service accounts found" }] }; }
  • Input schema definition for the list-serviceaccounts tool, accepting optional namespace.
    name: "list-serviceaccounts", description: "List Kubernetes service accounts in a namespace", inputSchema: { type: "object", properties: { namespace: { type: "string", description: "The namespace to list service accounts from (optional, defaults to current context namespace)" } } } },
  • server.js:1392-1394 (registration)
    Registration of all tools list, including list-serviceaccounts, via the ListToolsRequestHandler.
    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