Skip to main content
Glama
abhijeetka
by abhijeetka

get_pods

Retrieve all Kubernetes pods in a specified namespace to monitor and manage containerized applications running in your cluster.

Instructions

Get all pods in the specified namespace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNodefault

Implementation Reference

  • The main handler function for the 'get_pods' tool. It uses kubectl to fetch pods in the specified namespace (default 'default') as JSON and returns the data or an error dictionary.
    @mcp.tool()
    async def get_pods(namespace: str = "default") -> dict:
        """Get all pods in the specified namespace"""
        try:
            cmd = ["kubectl", "get", "pods", "-n", namespace, "-o", "json"]
            result = subprocess.run(cmd, capture_output=True, text=True, check=True)
            return json.loads(result.stdout)
        except subprocess.CalledProcessError as e:
            return {"error": f"Failed to get pods: {str(e)}"}
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a read operation ('Get') but doesn't disclose if it requires permissions, returns paginated results, or handles errors. For a tool with zero annotation coverage, this leaves critical behavioral traits unspecified.

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 with no wasted words. It front-loads the core action ('Get all pods') and specifies the scope concisely. Every word earns its place, making it easy to parse quickly.

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 no annotations, 0% schema coverage, and no output schema, the description is incomplete. It lacks details on permissions, response format, error handling, or usage context. For a tool in a Kubernetes environment with many siblings, more guidance is needed to ensure correct agent invocation.

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%, but the description adds context by mentioning 'specified namespace', which clarifies the purpose of the single parameter. However, it doesn't explain the parameter's role beyond this, such as default behavior or valid values. With 1 parameter, the baseline is 4, but the description only partially compensates for the lack of schema details.

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') and resource ('all pods'), specifying the scope with 'in the specified namespace'. It distinguishes from siblings like 'describe_pod' (detailed view) and 'get_failing_pods' (filtered subset), though it doesn't explicitly name alternatives. The purpose is specific and actionable.

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. It doesn't mention prerequisites like needing cluster access, compare to 'get_failing_pods' for filtered results, or advise on namespace selection. The description only states what it does, not when to choose it.

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/abhijeetka/mcp-k8s-server'

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