Skip to main content
Glama

k8s_delete_pod

Delete a specific Kubernetes pod for troubleshooting or cleanup. The pod will be recreated if managed by a controller.

Instructions

Delete a specific pod (it will be recreated if managed by a controller)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesPod name
namespaceNoKubernetes namespace (default: 'default')

Implementation Reference

  • The handler function `deletePod` performs the actual deletion of the Kubernetes pod using the API client.
    export async function deletePod(args: Record<string, unknown>): Promise<string> {
      const api = getCoreV1Api();
      const namespace = (args.namespace as string) || "default";
      const name = args.name as string;
    
      if (!name) throw new Error("Pod name is required");
    
      await api.deleteNamespacedPod(name, namespace);
      return `Pod '${name}' in namespace '${namespace}' has been deleted.`;
    }
  • The schema definition and input validation for the `k8s_delete_pod` tool.
      name: "k8s_delete_pod",
      description: "Delete a specific pod (it will be recreated if managed by a controller)",
      inputSchema: {
        type: "object" as const,
        properties: {
          name: { type: "string", description: "Pod name" },
          namespace: { type: "string", description: "Kubernetes namespace (default: 'default')" },
        },
        required: ["name"],
      },
    },
  • The registration/dispatch entry point in `handleKubernetesTool` that maps `k8s_delete_pod` to the `deletePod` handler.
    case "k8s_delete_pod": return deletePod(a);
Behavior4/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 discloses a key behavioral trait: deletion may not be permanent if the pod is controller-managed, which is crucial for understanding the tool's effect. However, it lacks details on permissions required, error handling, or confirmation prompts, leaving some behavioral aspects unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Delete a specific pod') and adds a critical behavioral note without unnecessary words. Every part of the sentence earns its place by providing essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity as a destructive operation with no annotations and no output schema, the description is reasonably complete. It covers the main action and a key caveat, but could be more comprehensive by including details like return values or error conditions. However, for a tool with only two parameters and high schema coverage, it provides sufficient context for basic use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters ('name' and 'namespace') well-documented in the schema. The description does not add any additional meaning or context about the parameters beyond what the schema provides, such as format examples or constraints, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Delete') and resource ('a specific pod'), making the purpose explicit. It also distinguishes this tool from sibling tools like 'k8s_describe_pod' or 'k8s_get_pods' by specifying it performs deletion rather than inspection or listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning that pods 'will be recreated if managed by a controller,' which suggests when this tool might be less effective, but it does not provide explicit guidance on when to use it versus alternatives like 'k8s_rollback_deployment' or 'k8s_scale_deployment' for managing pods indirectly. No clear exclusions or prerequisites are stated.

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/batu-sonmez/infraclaude'

If you have feedback or need assistance with the MCP directory API, please join our Discord server