Skip to main content
Glama

pod_delete

Delete Kubernetes pods from specified namespaces using the k8s-pilot server to manage cluster resources and maintain operational efficiency.

Instructions

Delete a pod from the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The pod name to delete

Returns: Status of the deletion operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes

Implementation Reference

  • The main handler function for the 'pod_delete' tool. It uses the Kubernetes CoreV1Api to delete a pod in the specified namespace and context. Includes decorators for MCP tool registration (@mcp.tool()), current context usage (@use_current_context), and readonly permission check (@check_readonly_permission). Returns a status dictionary indicating success, failure, or error.
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
    def pod_delete(context_name: str, namespace: str, name: str):
        """
        Delete a pod from the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The pod name to delete
    
        Returns:
            Status of the deletion operation
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
    
        try:
            # Delete the pod
            api_response = core_v1.delete_namespaced_pod(
                name=name,
                namespace=namespace,
                body={}  # Default deletion options
            )
    
            # Check if the response indicates success
            if api_response.status == "Success":
                return {
                    "name": name,
                    "namespace": namespace,
                    "status": "Deleted",
                    "message": f"Pod {name} deleted successfully"
                }
            else:
                return {
                    "name": name,
                    "namespace": namespace,
                    "status": "Failed",
                    "message": f"Failed to delete pod {name}: {api_response.status}"
                }
        except Exception as e:
            return {
                "name": name,
                "namespace": namespace,
                "status": "Error",
                "message": f"An error occurred while deleting pod {name}: {str(e)}"
            }
  • tools/pod.py:285-285 (registration)
    The @mcp.tool() decorator registers the pod_delete function as an MCP tool.
    @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 full burden. It states this is a deletion operation but doesn't disclose critical behavioral traits: whether deletion is permanent, if it requires specific RBAC permissions, what happens to associated resources, or error conditions. For a destructive operation with zero annotation coverage, this minimal disclosure is inadequate.

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 clear sections (purpose, Args, Returns) and uses minimal words to convey essential information. Every sentence serves a purpose: the first states the action, the Args explain parameters, and Returns indicates outcome. It could be slightly more concise by integrating parameter explanations into a single paragraph.

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 this is a destructive operation with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is moderately complete. It covers the basic purpose and parameters adequately but lacks crucial context about behavioral implications, error handling, and relationship to sibling tools. The Returns section is vague ('Status of the deletion operation') without specifying format or possible values.

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 semantic explanations for all three parameters (context_name, namespace, name) in the Args section, adding meaningful context beyond the bare schema. The parameter documentation is complete and helpful, though it doesn't explain format constraints or provide 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 pod from the specified namespace'), making the purpose immediately understandable. It distinguishes from siblings like pod_list or pod_detail by specifying deletion rather than listing or viewing. However, it doesn't explicitly differentiate from other deletion tools like deployment_delete or configmap_delete beyond the resource type.

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 (e.g., needing appropriate permissions), consequences of deletion, or when to choose this over other pod-related tools like pod_update. With many sibling tools available, this lack of contextual guidance is a significant gap.

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