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 };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states 'analyze' but doesn't disclose behavioral traits such as whether it's a read-only operation, if it requires specific permissions, what the output format is, or if it has rate limits. For a tool with no annotations, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's appropriately sized and front-loaded, though it could benefit from more detail given the lack of annotations and output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of analyzing resource usage, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'analyze' entails, what resources are covered, or the return values, leaving significant gaps for the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for its single parameter ('namespace'), so the schema already documents it well. The description doesn't add any meaning beyond the schema, as it doesn't mention parameters at all. With high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Analyze resource usage across the cluster' clearly states the verb ('analyze') and resource ('resource usage'), but it's vague about what specific analysis is performed (e.g., CPU, memory, metrics) and doesn't distinguish it from sibling tools like 'get-cluster-metrics', 'get-node-metrics', or 'get-pod-metrics'. It provides a basic purpose but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get-cluster-metrics' or other metrics-related siblings. The description doesn't mention prerequisites, context, or exclusions, leaving the agent without usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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