Skip to main content
Glama

clusterrole_get

Retrieve detailed information about a specific Kubernetes ClusterRole, including its permissions and rules, to manage access control across clusters.

Instructions

Get details of a specific ClusterRole.

Args: context_name: The Kubernetes context name name: The ClusterRole name

Returns: Detailed information about the ClusterRole

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
nameYes

Implementation Reference

  • Handler function for clusterrole_get tool. Retrieves details of a specific ClusterRole using Kubernetes RBAC API, returns name and rules.
    @mcp.tool()
    @use_current_context
    def clusterrole_get(context_name: str, name: str):
        """
        Get details of a specific ClusterRole.
    
        Args:
            context_name: The Kubernetes context name
            name: The ClusterRole name
    
        Returns:
            Detailed information about the ClusterRole
        """
        rbac_v1: RbacAuthorizationV1Api = get_api_clients(context_name)["rbac"]
        clusterrole = rbac_v1.read_cluster_role(name=name)
        return {
            "name": clusterrole.metadata.name,
            "rules": [{"api_groups": rule.api_groups, "resources": rule.resources, "verbs": rule.verbs} for rule in clusterrole.rules]
        }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a 'Get' operation which implies read-only behavior, but doesn't explicitly confirm this or mention any side effects. It doesn't disclose authentication requirements, rate limits, error conditions, or what format the 'detailed information' returns. For a Kubernetes tool with security implications, 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 appropriately concise with a clear purpose statement followed by Args and Returns sections. Every sentence earns its place: the first states the purpose, the next two explain parameters, and the last describes the return. However, the formatting with quotes and line breaks could be cleaner for direct consumption by an AI agent.

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?

Given this is a Kubernetes tool with no annotations, no output schema, and 2 parameters with 0% schema coverage, the description is incomplete. It doesn't explain what 'detailed information' includes, doesn't mention authentication or permission requirements, and doesn't provide error handling guidance. For a tool that interacts with cluster security objects, this leaves significant gaps for an AI agent.

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%, so the schema provides no parameter documentation. The description adds basic semantic meaning by explaining that 'context_name' refers to 'The Kubernetes context name' and 'name' refers to 'The ClusterRole name'. However, it doesn't provide format examples, constraints, or explain what happens if parameters are invalid. This provides minimal but essential clarification beyond the bare schema.

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 tool's purpose with 'Get details of a specific ClusterRole', which is a specific verb+resource combination. It distinguishes from siblings like clusterrole_list (list vs get details) and clusterrole_create/delete (read vs write operations). However, it doesn't explicitly contrast with role_get (ClusterRole vs Role), which would make it a perfect 5.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to use clusterrole_get versus clusterrole_list (detailed view vs listing), nor does it specify prerequisites like needing proper Kubernetes context or permissions. The agent must infer usage from the tool name and sibling relationships alone.

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