Skip to main content
Glama

deployment_update

Update Kubernetes deployments by modifying container images and scaling replicas across clusters using the k8s-pilot server.

Instructions

Update an existing Deployment in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Deployment name image: The new container image to update replicas: The new number of replicas

Returns: Status of the update operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes
imageYes
replicasYes

Implementation Reference

  • The main handler function for the 'deployment_update' tool. It reads the existing deployment, updates the container image and replicas, then replaces the deployment using the Kubernetes API. Registered via @mcp.tool() decorator.
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
    def deployment_update(context_name: str, namespace: str, name: str, image: str, replicas: int):
        """
        Update an existing Deployment in the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The Deployment name
            image: The new container image to update
            replicas: The new number of replicas
    
        Returns:
            Status of the update operation
        """
        apps_v1: AppsV1Api = get_api_clients(context_name)["apps"]
        deployment = apps_v1.read_namespaced_deployment(name=name, namespace=namespace)
        deployment.spec.template.spec.containers[0].image = image
        deployment.spec.replicas = replicas
        updated_deployment = apps_v1.replace_namespaced_deployment(name=name, namespace=namespace, body=deployment)
        return {"name": updated_deployment.metadata.name, "status": "Updated"}
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is an update operation but doesn't mention whether it's idempotent, what permissions are required, whether it triggers a rolling update, or potential side effects. The return statement is vague ('Status of the update 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 clear purpose statement followed by Args and Returns sections. It's appropriately sized for a 5-parameter tool, though the return statement could be more specific to improve front-loading of information.

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?

For a mutation tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what happens during the update (rolling restart? downtime?), error conditions, or what the return status contains. The sibling tools list shows this is part of a Kubernetes management system, but no Kubernetes-specific context is provided.

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 clear explanations for all 5 parameters beyond their titles, explaining what each represents (e.g., 'The Kubernetes context name', 'The new container image to update'). This adds significant value over the bare schema.

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 ('Update') and resource ('an existing Deployment in the specified namespace'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'deployment_create' or 'deployment_delete', which would be needed for a perfect score.

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 like 'deployment_create' or 'deployment_get'. It mentions the namespace context but doesn't explain prerequisites, dependencies, or typical scenarios for deployment updates.

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