Skip to main content
Glama

clusterrole_list

Retrieve and list all ClusterRoles in a Kubernetes cluster by specifying the context name. Enables efficient management and oversight of ClusterRole details.

Instructions

List all ClusterRoles in the cluster.

Args: context_name: The Kubernetes context name

Returns: List of ClusterRole basic information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes

Implementation Reference

  • The clusterrole_list tool handler: lists all ClusterRoles in the Kubernetes cluster using the RBAC API for the specified context. Registered via @mcp.tool() decorator.
    @mcp.tool() @use_current_context def clusterrole_list(context_name: str): """ List all ClusterRoles in the cluster. Args: context_name: The Kubernetes context name Returns: List of ClusterRole basic information """ rbac_v1: RbacAuthorizationV1Api = get_api_clients(context_name)["rbac"] clusterroles = rbac_v1.list_cluster_role() result = [{"name": clusterrole.metadata.name} for clusterrole in clusterroles.items] return result

Other Tools

Related 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/bourbonkk/k8s-pilot'

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