Skip to main content
Glama

role_get

Retrieve detailed information about a specific Kubernetes Role, including its permissions and configuration, to manage access controls in your cluster.

Instructions

Get details of a specific Role.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Role name

Returns: Detailed information about the Role

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes

Implementation Reference

  • The main handler function for the 'role_get' tool. It retrieves details of a specific Kubernetes Role using the RBAC API. Decorated with @mcp.tool() for registration and @use_current_context for context management. Includes input parameters via type hints and docstring describing schema.
    @mcp.tool()
    @use_current_context
    def role_get(context_name: str, namespace: str, name: str):
        """
        Get details of a specific Role.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The Role name
    
        Returns:
            Detailed information about the Role
        """
        rbac_v1: RbacAuthorizationV1Api = get_api_clients(context_name)["rbac"]
        role = rbac_v1.read_namespaced_role(name=name, namespace=namespace)
        return {
            "name": role.metadata.name,
            "rules": [{"api_groups": rule.api_groups, "resources": rule.resources, "verbs": rule.verbs} for rule in role.rules]
        }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Get details' implies a read-only operation, it doesn't specify authentication requirements, error conditions, rate limits, or what format the detailed information will be returned in. The description mentions returns 'Detailed information about the Role' but provides no specifics about what that includes.

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

Conciseness5/5

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

The description is perfectly structured and concise - a clear purpose statement followed by well-organized parameter documentation. Every sentence serves a purpose with zero waste, and the information is front-loaded with the most important details first.

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

Completeness3/5

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

For a read operation with 3 parameters and no output schema, the description provides adequate but minimal coverage. It explains what the tool does and documents the parameters, but lacks information about return format, error handling, or authentication requirements. The absence of an output schema means the description should ideally provide more detail about what 'Detailed information' includes.

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

Parameters4/5

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

The description provides clear parameter documentation in the Args section, explaining what each parameter represents (context_name, namespace, name). With 0% schema description coverage, this parameter documentation is essential and adds significant value beyond the bare schema. However, it doesn't provide examples or format requirements for the parameters.

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 as 'Get details of a specific Role' with a specific verb ('Get') and resource ('Role'), making it immediately understandable. However, it doesn't explicitly differentiate from its sibling 'clusterrole_get' which performs a similar function for ClusterRoles, leaving some ambiguity about when to use each.

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. With sibling tools like 'role_list' (for listing roles) and 'clusterrole_get' (for cluster-level roles), there's no indication of when this specific role retrieval tool is appropriate versus those other options.

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