Skip to main content
Glama

deployment_delete

Delete Kubernetes deployments by specifying context, namespace, and deployment name to remove resources from clusters managed by k8s-pilot.

Instructions

Delete a Deployment from the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Deployment name

Returns: Status of the deletion operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes

Implementation Reference

  • The handler function that implements the logic to delete a Kubernetes Deployment using the AppsV1Api client.
    def deployment_delete(context_name: str, namespace: str, name: str):
        """
        Delete a Deployment from the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The Deployment name
    
        Returns:
            Status of the deletion operation
        """
        apps_v1: AppsV1Api = get_api_clients(context_name)["apps"]
        apps_v1.delete_namespaced_deployment(name=name, namespace=namespace)
        return {"name": name, "status": "Deleted"}
  • The @mcp.tool() decorator registers the deployment_delete function as an MCP tool.
    @mcp.tool()
  • Docstring defining the input parameters (context_name, namespace, name) and return value for the tool.
    """
    Delete a Deployment from the specified namespace.
    
    Args:
        context_name: The Kubernetes context name
        namespace: The Kubernetes namespace
        name: The Deployment name
    
    Returns:
        Status of the deletion operation
    """
  • Decorators providing current context management and readonly permission check for the tool.
    @use_current_context
    @check_readonly_permission
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is deletion but lacks critical details: whether this is destructive (likely yes, but not confirmed), if it requires specific Kubernetes RBAC permissions, what happens to associated resources (e.g., pods, services), or error handling (e.g., if deployment doesn't exist). The return statement is vague ('Status of the deletion operation') without specifying format or possible outcomes.

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 parameter and return sections. Every sentence serves a purpose: the first states the action, the next three define parameters, and the last describes returns. It's front-loaded with the core functionality, though the return statement could be more specific.

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 destructive operation like deletion with no annotations and no output schema, the description is incomplete. It lacks crucial context: safety warnings, permission requirements, impact on related resources, and detailed return value expectations. Given the complexity and risk of deleting Kubernetes deployments, more behavioral and operational guidance is needed.

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 explicitly lists and briefly defines all three parameters ('context_name', 'namespace', 'name'), adding meaningful context beyond the schema which has 0% description coverage and only provides titles. This compensates well for the schema's lack of documentation, though it doesn't elaborate on parameter formats (e.g., namespace naming conventions) or examples.

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 ('Delete') and resource ('a Deployment from the specified namespace'), making the purpose immediately understandable. It distinguishes from siblings like 'deployment_create' or 'deployment_update' by specifying deletion, though it doesn't explicitly contrast with other deletion tools like 'namespace_delete' or 'pod_delete'.

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. While the description implies it's for deleting deployments, it doesn't mention prerequisites (e.g., needing proper permissions), consequences (e.g., pods being terminated), or when to choose other deletion tools like 'namespace_delete' for broader cleanup.

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