Skip to main content
Glama

replicaset_update

Update an existing ReplicaSet's container image and replica count in a specified Kubernetes namespace to modify application deployment configurations.

Instructions

Update an existing ReplicaSet in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The ReplicaSet 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 handler function for the 'replicaset_update' tool. It updates an existing ReplicaSet by changing the container image and the number of replicas using the Kubernetes AppsV1Api.
    def replicaset_update(context_name: str, namespace: str, name: str, image: str, replicas: int):
        """
        Update an existing ReplicaSet in the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The ReplicaSet 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"]
        replicaset = apps_v1.read_namespaced_replica_set(name=name, namespace=namespace)
        replicaset.spec.template.spec.containers[0].image = image
        replicaset.spec.replicas = replicas
        updated_replicaset = apps_v1.replace_namespaced_replica_set(name=name, namespace=namespace, body=replicaset)
        return {"name": updated_replicaset.metadata.name, "status": "Updated"}
  • Registers the 'replicaset_update' tool using the @mcp.tool() decorator from the MCP server.
    @mcp.tool()
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 states this is an update operation, implying mutation, but lacks details on permissions required, whether changes are reversible, potential side effects (e.g., pod restarts), or rate limits. The description is minimal and doesn't disclose key behavioral traits beyond the basic action.

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 and front-loaded with the core purpose, followed by parameter and return sections. It's concise with no wasted words, though the parameter explanations are brief and could be more detailed without sacrificing efficiency.

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 the complexity of a Kubernetes update operation, no annotations, and no output schema, the description is incomplete. It lacks information on error handling, response format, dependencies (e.g., cluster connectivity), and behavioral nuances. For a mutation tool with 5 parameters, this leaves significant gaps for an agent to operate effectively.

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 lists all 5 parameters with brief explanations (e.g., 'The new container image to update'), adding meaningful context beyond the schema's titles. However, it doesn't cover format details (e.g., image tag syntax) or constraints (e.g., valid replica counts), leaving some gaps.

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 an existing ReplicaSet') and specifies the target resource, which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'replicaset_create' or 'replicaset_get', though the verb 'update' implies modification of an existing resource rather than creation or retrieval.

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. There are no mentions of prerequisites, conditions, or comparisons to sibling tools such as 'replicaset_create' for new resources or 'replicaset_get' for viewing. This leaves the agent without context for tool selection.

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