Skip to main content
Glama

delete

Remove a specific Kubernetes resource like pods, deployments, or services from your cluster by specifying its type and name.

Instructions

Delete a Kubernetes resource

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resourceYesThe resource type (pod, deployment, service, etc.)
nameYesThe name of the resource
namespaceNoThe namespace of the resource (optional, defaults to current context namespace)

Implementation Reference

  • The handler function for the 'delete' tool that executes the Kubernetes 'kubectl delete' command based on the provided resource type, name, and optional namespace.
    case "delete": { const { resource, name, namespace } = args; const nsArg = namespace ? `-n ${namespace}` : ""; const cmd = `kubectl delete ${resource} ${name} ${nsArg}`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || `Deleted ${resource} ${name}` }] }; }
  • The input schema definition for the 'delete' tool, specifying parameters for resource type, name, and optional namespace.
    name: "delete", description: "Delete a Kubernetes resource", inputSchema: { type: "object", properties: { resource: { type: "string", description: "The resource type (pod, deployment, service, etc.)" }, name: { type: "string", description: "The name of the resource" }, namespace: { type: "string", description: "The namespace of the resource (optional, defaults to current context namespace)" } }, required: ["resource", "name"] }
  • server.js:1392-1394 (registration)
    The ListTools request handler that returns the list of all tools, including 'delete', for tool discovery.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { 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/thekaranpargaie/kube-mcp'

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