Skip to main content
Glama

pod_update

Update Kubernetes pod labels to modify metadata for existing pods, enabling resource organization and management within clusters.

Instructions

Update an existing pod's metadata (only labels can be updated for an existing pod).

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The pod name labels: New labels to apply to the pod

Returns: Information about the updated pod

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes
labelsNo

Implementation Reference

  • The handler function implementing the pod_update tool logic. It reads the existing pod, updates its labels if provided, patches the pod via Kubernetes API, and returns the updated pod information.
    def pod_update(context_name: str, namespace: str, name: str,
                   labels: Optional[Dict[str, str]] = None):
        """
        Update an existing pod's metadata (only labels can be updated for an existing pod).
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The pod name
            labels: New labels to apply to the pod
    
        Returns:
            Information about the updated pod
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
    
        # Get the current pod
        pod = core_v1.read_namespaced_pod(name=name, namespace=namespace)
    
        # Update pod labels if provided
        if labels:
            pod.metadata.labels = labels
    
        # Update the pod in Kubernetes
        updated_pod = core_v1.patch_namespaced_pod(
            name=name,
            namespace=namespace,
            body={"metadata": {"labels": labels}}
        )
    
        result = {
            "name": updated_pod.metadata.name,
            "namespace": updated_pod.metadata.namespace,
            "status": updated_pod.status.phase,
            "labels": updated_pod.metadata.labels,
        }
        return result
  • tools/pod.py:243-243 (registration)
    The @mcp.tool() decorator registers the pod_update function as an MCP tool.
    @mcp.tool()
  • tools/pod.py:244-245 (registration)
    Decorators providing context and permission checks for the pod_update tool.
    @use_current_context
    @check_readonly_permission
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 mentions that only labels can be updated, which is useful behavioral context, but doesn't disclose other critical traits such as required permissions, whether the update is idempotent, potential side effects, or error handling. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding the tool's behavior beyond the basic operation.

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 well-structured with a purpose statement followed by 'Args' and 'Returns' sections, making it easy to parse. It's appropriately sized with no redundant information. However, the 'Returns' section is vague ('Information about the updated pod'), which slightly reduces efficiency, but overall it's front-loaded and concise.

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 complexity (a mutation tool with 4 parameters), no annotations, and no output schema, the description is moderately complete. It explains the purpose and parameters well but lacks details on behavioral aspects like permissions, side effects, and return format. For a tool in this context, it should do more to compensate for the missing structured data, making it adequate but with clear gaps.

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 provides a clear 'Args' section that explains each parameter's purpose (e.g., 'context_name: The Kubernetes context name'), adding meaningful semantics beyond the bare schema. This covers all 4 parameters effectively, though it doesn't detail format constraints or examples. Given the low schema coverage, this is strong compensation, but not exhaustive.

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 'Update an existing pod's metadata (only labels can be updated for an existing pod)' which specifies the verb (update), resource (pod), and scope (metadata/labels). It distinguishes from siblings like pod_create, pod_delete, and pod_detail by focusing on metadata updates rather than creation, deletion, or general details. However, it doesn't explicitly differentiate from configmap_update or other resource updates beyond mentioning it's for pods specifically.

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 updating pod labels, as it states 'only labels can be updated for an existing pod,' which suggests this is the specific use case. However, it doesn't provide explicit guidance on when to use this versus alternatives like pod_create for new pods or other update tools for different resources. No exclusions or prerequisites are mentioned, leaving usage context somewhat implied rather than clearly defined.

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