Skip to main content
Glama

clusterrole_list

List all ClusterRoles in a Kubernetes cluster to manage role-based access control permissions across namespaces.

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 handler function for the 'clusterrole_list' tool. It lists all ClusterRoles in the Kubernetes cluster using the RBAC API, decorated with @mcp.tool() for registration and execution.
    @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
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions the return type ('List of ClusterRole basic information') but doesn't cover critical aspects like permissions required, rate limits, pagination, error conditions, or what 'basic information' entails. For a Kubernetes list operation with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement followed by separate Args and Returns sections. Every sentence serves a purpose, though the 'Returns' line could be more specific about what 'basic information' includes to improve utility without adding bulk.

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

Completeness2/5

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

For a Kubernetes list tool with no annotations and no output schema, the description is incomplete. It lacks details on authentication needs, potential side effects, response format, error handling, and differentiation from sibling tools. The minimal parameter and return documentation don't compensate for these gaps in a resource-intensive context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description includes an 'Args' section that documents the single parameter 'context_name' and its purpose ('The Kubernetes context name'). This adds meaningful semantics beyond the bare schema, though it doesn't elaborate on format constraints or examples. With one parameter fully described, it meets the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all ClusterRoles in the cluster'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'clusterrole_get' or 'role_list', which would require more precise scope definition.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'clusterrole_get' (for specific ClusterRoles) or 'role_list' (for namespace-scoped Roles). The description only states what it does without contextual usage instructions or exclusions.

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

Install Server

Other 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