Skip to main content
Glama

list-services

List Kubernetes services in a namespace to view available services and their configurations for cluster management.

Instructions

List Kubernetes services in a namespace

Input Schema

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

Implementation Reference

  • Handler function for 'list-services' tool that executes 'kubectl get svc' command to list services in the specified namespace.
    case "list-services": { const { namespace } = args || {}; const nsArg = namespace ? `-n ${namespace}` : ""; const cmd = `kubectl get svc ${nsArg} -o wide`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || "No services found" }] }; }
  • Tool definition including input schema for 'list-services', which accepts an optional namespace parameter.
    name: "list-services", description: "List Kubernetes services in a namespace", inputSchema: { type: "object", properties: { namespace: { type: "string", description: "The namespace to list services from (optional, defaults to current context namespace)" } } } },
  • server.js:1392-1394 (registration)
    Registration of all tools list, including 'list-services', via the ListToolsRequestHandler returning the tools array.
    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