Skip to main content
Glama

k8s_describe_pod

Retrieve detailed Kubernetes pod information including containers, resources, and events to diagnose issues and monitor pod status.

Instructions

Get detailed information about a specific pod including containers, resources, and events

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesPod name
namespaceNoKubernetes namespace (default: 'default')

Implementation Reference

  • Handler function for `k8s_describe_pod` that fetches pod details from the Kubernetes API and formats them.
    export async function describePod(args: Record<string, unknown>): Promise<string> {
      const api = getCoreV1Api();
      const namespace = (args.namespace as string) || "default";
      const name = args.name as string;
    
      if (!name) throw new Error("Pod name is required");
    
      const response = await api.readNamespacedPod(name, namespace);
      const pod = response.body;
    
      const lines: string[] = [
        `Name:         ${pod.metadata?.name}`,
        `Namespace:    ${pod.metadata?.namespace}`,
        `Node:         ${pod.spec?.nodeName || "N/A"}`,
        `Status:       ${pod.status?.phase}`,
        `IP:           ${pod.status?.podIP || "N/A"}`,
        `Labels:       ${pod.metadata?.labels ? Object.entries(pod.metadata.labels).map(([k, v]) => `${k}=${v}`).join(", ") : "none"}`,
        "",
        "Containers:",
      ];
    
      for (const container of pod.spec?.containers || []) {
        const status = pod.status?.containerStatuses?.find((s) => s.name === container.name);
        lines.push(`  ${container.name}:`);
        lines.push(`    Image:    ${container.image}`);
        lines.push(`    Ready:    ${status?.ready ?? "unknown"}`);
        lines.push(`    Restarts: ${status?.restartCount ?? 0}`);
    
        if (container.resources?.limits) {
          lines.push(`    Limits:   CPU=${container.resources.limits.cpu || "none"}, Mem=${container.resources.limits.memory || "none"}`);
        }
        if (container.resources?.requests) {
          lines.push(`    Requests: CPU=${container.resources.requests.cpu || "none"}, Mem=${container.resources.requests.memory || "none"}`);
        }
      }
    
      // Events
      const events = await api.listNamespacedEvent(
        namespace,
        undefined,
        undefined,
        undefined,
        `involvedObject.name=${name}`
      );
    
      if (events.body.items.length > 0) {
        lines.push("", "Events:");
        const eventHeaders = ["TYPE", "REASON", "AGE", "MESSAGE"];
        const eventRows = events.body.items
          .sort((a, b) => {
            const aTime = a.lastTimestamp || a.metadata?.creationTimestamp;
            const bTime = b.lastTimestamp || b.metadata?.creationTimestamp;
            return new Date(bTime || 0).getTime() - new Date(aTime || 0).getTime();
          })
          .slice(0, 10)
          .map((e) => [
            e.type || "Normal",
            e.reason || "",
            e.lastTimestamp ? formatAge(e.lastTimestamp) : "?",
            e.message || "",
          ]);
        lines.push(formatTable(eventHeaders, eventRows));
      }
    
      return lines.join("\n");
    }
  • Registration of `k8s_describe_pod` tool with its schema definition.
    {
      name: "k8s_describe_pod",
      description: "Get detailed information about a specific pod including containers, resources, and events",
      inputSchema: {
        type: "object" as const,
        properties: {
          name: { type: "string", description: "Pod name" },
          namespace: { type: "string", description: "Kubernetes namespace (default: 'default')" },
        },
        required: ["name"],
      },
    },
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 this is a read operation ('Get detailed information'), which implies non-destructive behavior, but doesn't disclose critical behavioral traits like authentication requirements, rate limits, error conditions, or output format. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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 ('Get detailed information about a specific pod') and adds useful scope details ('including containers, resources, and events'). Every word earns its place with zero waste or redundancy.

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

Completeness3/5

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

Given the tool's moderate complexity (read operation with 2 parameters), 100% schema coverage, but no annotations or output schema, the description is minimally adequate. It covers the purpose and scope but lacks behavioral details (e.g., output format, error handling) that would be needed for full completeness, especially without annotations to fill gaps.

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 descriptions for both parameters ('name' and 'namespace'). The description doesn't add any parameter-specific semantics beyond what the schema provides, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate as the schema adequately documents parameters.

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 verb ('Get detailed information') and resource ('about a specific pod'), specifying the scope ('including containers, resources, and events'). It distinguishes from generic list tools like 'k8s_get_pods' by focusing on detailed information for a specific pod, though it doesn't explicitly differentiate from similar describe tools like 'k8s_describe_node'.

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

Usage Guidelines3/5

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

The description implies usage when detailed pod information is needed, but provides no explicit guidance on when to use this versus alternatives like 'k8s_get_pods' (for listing) or 'k8s_get_pod_logs' (for logs). It mentions the scope of information returned, which helps contextualize its purpose, but lacks clear when/when-not instructions or named alternatives.

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/batu-sonmez/infraclaude'

If you have feedback or need assistance with the MCP directory API, please join our Discord server