role_delete
Delete a Role from a specified namespace in Kubernetes to manage access control and permissions.
Instructions
Delete a Role from the specified namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Role name
Returns: Status of the deletion operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| namespace | Yes | ||
| name | Yes |
Implementation Reference
- tools/role.py:74-91 (handler)Handler function for the 'role_delete' tool. Deletes a Kubernetes Role in the specified namespace using the RBAC API. Registered via @mcp.tool() decorator.@mcp.tool() @use_current_context @check_readonly_permission def role_delete(context_name: str, namespace: str, name: str): """ Delete a Role from the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Role name Returns: Status of the deletion operation """ rbac_v1: RbacAuthorizationV1Api = get_api_clients(context_name)["rbac"] rbac_v1.delete_namespaced_role(name=name, namespace=namespace) return {"name": name, "status": "Deleted"}