Skip to main content
Glama

get-pod-metrics

Retrieve detailed performance metrics for a specific Kubernetes pod to monitor resource usage and analyze pod behavior within your cluster.

Instructions

Get detailed metrics for a pod

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
podYesThe name of the pod
namespaceNoThe namespace of the pod (optional, defaults to current context namespace)

Implementation Reference

  • The handler function for the 'get-pod-metrics' tool. It extracts the pod name and optional namespace from arguments, constructs a kubectl command to retrieve the resource specifications (requests/limits) for all containers in the pod using jsonpath and pipes to jq for formatting, executes it via execAsync, and returns the stdout as text content or an error message.
    case "get-pod-metrics": {
      const { pod, namespace } = args;
      const nsArg = namespace ? `-n ${namespace}` : "";
      const cmd = `kubectl get pod ${pod} ${nsArg} -o jsonpath='{.spec.containers[*].resources}' | jq .`;
      const { stdout } = await execAsync(cmd);
      return {
        content: [{ type: "text", text: stdout || "Unable to get pod metrics" }]
      };
    }
  • Input schema for the 'get-pod-metrics' tool, defining required 'pod' string parameter and optional 'namespace' string.
    inputSchema: {
      type: "object",
      properties: {
        pod: { 
          type: "string",
          description: "The name of the pod"
        },
        namespace: { 
          type: "string",
          description: "The namespace of the pod (optional, defaults to current context namespace)"
        }
      },
      required: ["pod"]
    }
  • server.js:1095-1111 (registration)
    Registration of the 'get-pod-metrics' tool in the tools array used by ListToolsRequestHandler. Includes name, description, and input schema.
      name: "get-pod-metrics",
      description: "Get detailed metrics for a pod",
      inputSchema: {
        type: "object",
        properties: {
          pod: { 
            type: "string",
            description: "The name of the pod"
          },
          namespace: { 
            type: "string",
            description: "The namespace of the pod (optional, defaults to current context namespace)"
          }
        },
        required: ["pod"]
      }
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it 'gets' metrics but doesn't disclose behavioral traits like whether this requires specific permissions, if it's a read-only operation, what format the metrics are returned in, or if there are rate limits. This leaves significant gaps for a tool that likely interacts with cluster resources.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part of the sentence directly contributes to understanding what the tool does, making it highly concise and well-structured.

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 Kubernetes metrics retrieval, no annotations, and no output schema, the description is insufficient. It lacks details on metrics types (e.g., CPU, memory), time ranges, aggregation methods, or error handling, leaving the agent with incomplete context for effective use.

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?

Schema description coverage is 100%, with clear documentation for both parameters ('pod' as required name, 'namespace' as optional with default). The description adds no additional semantic context beyond the schema, such as example pod names or namespace constraints, so it meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('Get') and resource ('detailed metrics for a pod'), making the purpose immediately understandable. However, it doesn't differentiate from siblings like 'get-node-metrics' or 'get-cluster-metrics' that also retrieve metrics for different resources, leaving some ambiguity about scope.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'describe-pod' (which may include metrics) and 'get-cluster-metrics', there's no indication of context, prerequisites, or exclusions for selecting this specific tool.

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