Skip to main content
Glama

analyze-resource-usage

Analyze Kubernetes cluster resource usage to identify consumption patterns and optimize allocation across namespaces.

Instructions

Analyze resource usage across the cluster

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNoThe namespace to analyze (optional, analyzes all namespaces if not specified)

Implementation Reference

  • Handler implementation for the 'analyze-resource-usage' tool. Executes 'kubectl top pods --containers' in the specified namespace (or all) to show resource usage of pods and containers.
    const { namespace } = args || {}; const nsArg = namespace ? `-n ${namespace}` : ""; const cmd = `kubectl top pods ${nsArg} --containers`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || "Unable to analyze resource usage" }] }; }
  • Tool definition including name, description, and input schema for 'analyze-resource-usage'. This is part of the tools list returned by listTools handler.
    name: "analyze-resource-usage", description: "Analyze resource usage across the cluster", inputSchema: { type: "object", properties: { namespace: { type: "string", description: "The namespace to analyze (optional, analyzes all namespaces if not specified)" } } } },
  • server.js:1392-1394 (registration)
    Registration of the listTools handler which returns the array of all tools including 'analyze-resource-usage'.
    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