Skip to main content
Glama

pod_list

List Kubernetes pods in a specified namespace to monitor container status and manage cluster resources effectively.

Instructions

List all pods in a given namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace

Returns: List of pod basic information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the pod_list tool. It lists pods in the specified namespace using the Kubernetes CoreV1Api.
    @mcp.tool()
    @use_current_context
    def pod_list(context_name: str, namespace: str):
        """
        List all pods in a given namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
    
        Returns:
            List of pod basic information
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        pods = core_v1.list_namespaced_pod(namespace)
        result = [{"name": pod.metadata.name} for pod in pods.items]
        return result
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. While 'List all pods' implies a read-only operation, it doesn't disclose important behavioral aspects like what 'basic information' includes, whether results are paginated, error conditions, authentication requirements, or rate limits. The description is minimal beyond stating the basic function.

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 efficiently structured with a clear purpose statement followed by Args and Returns sections. Every sentence serves a purpose, though the 'Returns' section is somewhat vague ('List of pod basic information'). The structure is logical and front-loaded with the core functionality.

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 no annotations and no output schema, the description provides the minimum viable information: what it does and what parameters it takes. However, for a tool in a complex Kubernetes environment with many sibling tools, it lacks context about the return format, error handling, and differentiation from similar tools. The 'basic information' return description is particularly vague.

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 0%, so the description must compensate. It documents both parameters (context_name, namespace) in the Args section, explaining what they represent. However, it doesn't provide additional semantic context like format examples, valid values, or how these relate to Kubernetes concepts beyond their names.

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 ('List all pods') and resource ('in a given namespace'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'pod_detail' or 'get_node_pods', which also retrieve pod information but with different scopes or detail levels.

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 many sibling tools that interact with pods (pod_detail, pod_logs, get_node_pods, etc.), there's no indication of when this list-focused tool is appropriate versus when to use more specific pod tools.

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/bourbonkk/k8s-pilot'

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