clusterrole_delete
Remove a ClusterRole from a Kubernetes cluster to manage access control permissions. Specify the cluster context and role name to delete it.
Instructions
Delete a ClusterRole from the cluster.
Args: context_name: The Kubernetes context name name: The ClusterRole name
Returns: Status of the deletion operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes |
Implementation Reference
- tools/role.py:157-173 (handler)The main handler function decorated with @mcp.tool() for executing the clusterrole_delete tool. It deletes the specified ClusterRole using the Kubernetes RBAC API.@mcp.tool() @use_current_context @check_readonly_permission def clusterrole_delete(context_name: str, name: str): """ Delete a ClusterRole from the cluster. Args: context_name: The Kubernetes context name name: The ClusterRole name Returns: Status of the deletion operation """ rbac_v1: RbacAuthorizationV1Api = get_api_clients(context_name)["rbac"] rbac_v1.delete_cluster_role(name=name) return {"name": name, "status": "Deleted"}