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);

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