Skip to main content
Glama

delete_namespace

Destructive

Delete a Kubernetes namespace and everything in it, using dry-run previews and safety checks that refuse protected control-plane or credential-holding namespaces.

Instructions

[WRITE][risk=high] Delete a namespace and EVERYTHING in it. HIGH RISK — no undo.

Pass dry_run=True to preview without deleting.

Two namespaces are refused. The cluster's control-plane namespaces (kube-system, kube-public, kube-node-lease) need confirm=True — deleting one takes DNS and pod networking with it. The namespace holding this target's own ServiceAccount credential is refused outright and confirm does NOT override it: that delete revokes the credential it is running on. Both refusals are raised on the dry_run path too, so a preview never shows a green wouldDelete for a delete that would be rejected.

Args: name: Namespace name to delete. dry_run: If True, preview without deleting. confirm: Acknowledge deleting a protected control-plane namespace. target: k8s target name from config.

Input Schema

NameRequiredDescriptionDefault
nameYes
targetNo
confirmNo
dry_runNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, but the description goes far beyond them: 'no undo', the dry_run preview path, which namespaces are protected and why (DNS, pod networking), and the non-overridable credential self-revocation refusal. It even discloses that refusals fire on the dry_run path, preventing a false green preview.

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?

Front-loads [WRITE][risk=high] and the destructive scope, then preview mechanism, then refusal rules, then a clean Args block. Every sentence carries non-redundant operational information.

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

Completeness5/5

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

No output schema exists, yet the description still tells the agent what a preview would surface (a wouldDelete result) and enumerates the failure modes. For a high-risk mutation tool with four parameters, nothing material is missing.

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 carry semantics, and it does: dry_run is a preview switch, confirm acknowledges a protected control-plane namespace (and explicitly cannot override the SA refusal), target is a k8s target name from config. Only 'name' is left as the bare minimum, hence not a full 5.

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?

States a specific verb and resource with scope in caps ('Delete a namespace and EVERYTHING in it') and a risk tag, so it is immediately distinguishable from delete_pod, delete_deployment, and delete_job. An agent knows exactly what this does without opening the schema.

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

Usage Guidelines4/5

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

Gives explicit conditional guidance: pass dry_run=True to preview, confirm=True is required only for control-plane namespaces, and the ServiceAccount namespace is refused outright with confirm not overriding it. It does not name sibling tools as alternatives, but the when-to-use and when-not rules are unusually concrete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.