Skip to main content
Glama

deployment_create

Create Kubernetes deployments in specified namespaces to manage containerized applications with defined replicas, images, and labels.

Instructions

Create a Deployment in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Deployment name image: The container image to use replicas: Number of replicas labels: Labels to apply to the Deployment

Returns: Status of the creation operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes
imageYes
replicasYes
labelsYes

Implementation Reference

  • The main handler function for the 'deployment_create' tool. It is decorated with @mcp.tool() which registers it as an MCP tool. The function creates a Kubernetes Deployment in the specified namespace using the provided parameters.
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
    def deployment_create(context_name: str, namespace: str, name: str, image: str, replicas: int, labels: dict):
        """
        Create a Deployment in the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The Deployment name
            image: The container image to use
            replicas: Number of replicas
            labels: Labels to apply to the Deployment
    
        Returns:
            Status of the creation operation
        """
        apps_v1: AppsV1Api = get_api_clients(context_name)["apps"]
        deployment = V1Deployment(
            metadata=V1ObjectMeta(name=name, labels=labels),
            spec={
                "replicas": replicas,
                "selector": V1LabelSelector(match_labels=labels),
                "template": V1PodTemplateSpec(
                    metadata=V1ObjectMeta(labels=labels),
                    spec=V1PodSpec(containers=[V1Container(name=name, image=image)])
                )
            }
        )
        created_deployment = apps_v1.create_namespaced_deployment(namespace=namespace, body=deployment)
        return {"name": created_deployment.metadata.name, "status": "Created"}
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 'Create a Deployment' which implies a write/mutation operation, but doesn't disclose critical behavioral traits: required permissions/authentication, whether creation is idempotent, what happens on conflicts, rate limits, or what 'Status of the creation operation' entails. For a Kubernetes deployment creation tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 organized parameter and return sections. Every sentence adds value: the first states the action, the Args section documents parameters, and the Returns section indicates output. It's appropriately sized for a 6-parameter creation tool, though the parameter explanations could be slightly more detailed given the complexity.

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 tool's complexity (6 required parameters, no annotations, no output schema, nested objects in labels), the description is minimally adequate. It covers the basic purpose and parameters but lacks crucial context: no behavioral traits, no error handling information, no output details beyond 'Status', and no guidance on usage relative to siblings. For a Kubernetes deployment creation tool, this leaves the agent with significant gaps in understanding how to use it 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?

The description includes an 'Args' section that lists all 6 parameters with brief explanations, adding meaningful context beyond the schema (which has 0% description coverage). It clarifies what each parameter represents (e.g., 'The Kubernetes context name', 'Number of replicas'), though it doesn't provide format examples or constraints. Since schema coverage is 0%, the description compensates well by documenting all parameters, though some semantic details like label format expectations remain unspecified.

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 ('Create a Deployment') and resource ('in the specified namespace'), making the purpose immediately understandable. It distinguishes from sibling tools like deployment_get or deployment_list by specifying creation rather than retrieval. However, it doesn't explicitly differentiate from other creation tools like daemonset_create or statefulset_create beyond mentioning 'Deployment' specifically.

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. It doesn't mention prerequisites (like needing cluster access), when not to use it (e.g., for updates vs. creation), or how it relates to sibling tools like deployment_update or pod_create. The agent must infer usage from the tool name and parameter names alone.

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