Skip to main content
Glama
BenedatLLC

Kubernetes Tools MCP Server

by BenedatLLC

get_pod_container_statuses

Retrieve the status of all containers in a specified Kubernetes pod, including readiness, restart count, state, and resources. Use it to diagnose container health issues.

Instructions

Get the status for all containers in a specified Kubernetes pod.

Parameters
----------
pod_name : str
    Name of the pod to retrieve container statuses for.
namespace : str, optional
    Namespace of the pod (default is "default").

Returns
-------
list of ContainerStatus
    List of container status objects for the specified pod. Each ContainerStatus has the following fields:

    pod_name : str
        Name of the pod.
    namespace : str
        Namespace of the pod.
    container_name : str
        Name of the container.
    image : str
        Image name.
    ready : bool
        Whether the container is currently passing its readiness check.
        The value will change as readiness probes keep executing.
    restart_count : int
        Number of times the container has restarted.
    started : Optional[bool]
        Started indicates whether the container has finished its postStart
        lifecycle hook and passed its startup probe.
    stop_signal : Optional[str]
        Stop signal for the container.
    state : Optional[ContainerState]
        Current state of the container.
    last_state : Optional[ContainerState]
        Last state of the container. When Terminated, ``ran_for`` is how long
        that instance ran (``finished_at - started_at``). It is not the
        restart interval, which adds the back-off named in a Waiting
        ``state``'s message, and it is not how much time the container's log
        covers: a process can stop logging long before it is killed.
    volume_mounts : list[VolumeMountStatus]
        Status of volume mounts for the container
    resource_requests : dict[str, str]
        Describes the minimum amount of compute resources required. If Requests
        is omitted for a container, it defaults to Limits if that is explicitly specified,
        otherwise to an implementation-defined value. Requests cannot exceed Limits. 
    resource_limits : dict[str, str]
        Describes the maximum amount of compute resources allowed.
    allocated_resources : dict[str, str]
        Compute resources allocated for this container by the node.

Raises
------
K8sConfigError
    If unable to initialize the K8S API.
K8sApiError
    If the API call to read the pod fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pod_nameYes
namespaceNodefault

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.0
    • addedOutput schema / $defs / ContainerStateTerminated / properties / ran_for
      Added value: +{
      +  "anyOf": [
      +    {
      +      "format": "duration",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Ran For"
      +}
  2. First observed

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It documents the return structure and error conditions (K8sConfigError, K8sApiError), but it doesn't disclose any behavioral traits like whether it waits for readiness, pagination, rate limits, or freshness. It provides some error context but lacks operational behavior detail.

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

Conciseness3/5

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

The description is well-structured with sections for parameters, returns, and raises, but it is quite long—especially the detailed return field descriptions. While each sentence earns its place for a tool without an output schema, the verbose nested field explanations could be trimmed or moved to the output schema.

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

Completeness4/5

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

Given that there is no output schema, the description thoroughly documents the return type and its fields, which is essential. It also covers error cases. However, it omits usage context relative to other tools and doesn't mention any behavioral aspects like whether the status is cached or live.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It does by fully documenting both parameters: pod_name (required) and namespace (optional with default 'default'). This adds significant value beyond the schema, though it could mention constraints like namespace format.

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 states a specific verb+resource ('Get the status for all containers in a specified Kubernetes pod'), which clearly distinguishes it from siblings like get_pod_summaries or get_pod_spec. However, it doesn't explicitly contrast with those siblings, leaving some differentiation implicit.

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 you should use this tool to get container statuses for a pod, but it provides no explicit when-to-use guidance, no alternatives, and no exclusions. It doesn't say when to choose it over get_pod_summaries or get_logs_for_pod_and_container.

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