pvc_delete
Delete a PersistentVolumeClaim from a specified namespace in Kubernetes using context-based cluster management. Streamlines PVC cleanup and resource management.
Instructions
Delete a PersistentVolumeClaim from the specified namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The PersistentVolumeClaim name
Returns: Status of the deletion operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/pvc.py:106-123 (handler)The pvc_delete tool handler function, registered via @mcp.tool() decorator. It deletes a specified PersistentVolumeClaim using the Kubernetes CoreV1Api.@mcp.tool() @use_current_context @check_readonly_permission def pvc_delete(context_name: str, namespace: str, name: str): """ Delete a PersistentVolumeClaim from the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The PersistentVolumeClaim name Returns: Status of the deletion operation """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] core_v1.delete_namespaced_persistent_volume_claim(name=name, namespace=namespace) return {"name": name, "status": "Deleted"}
- tools/pvc.py:106-106 (registration)Registration of the pvc_delete tool using the @mcp.tool() decorator.@mcp.tool()