Skip to main content
Glama

role_list

List Kubernetes Roles in a specified namespace to manage access permissions and view role configurations within your cluster.

Instructions

List all Roles in a given namespace.

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

Returns: List of Role basic information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes

Implementation Reference

  • The handler function for the 'role_list' tool. It lists all Kubernetes Roles in the specified namespace within the given context using the RBAC API. The @mcp.tool() decorator registers it as an MCP tool.
    @mcp.tool()
    @use_current_context
    def role_list(context_name: str, namespace: str):
        """
        List all Roles in a given namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
    
        Returns:
            List of Role basic information
        """
        rbac_v1: RbacAuthorizationV1Api = get_api_clients(context_name)["rbac"]
        roles = rbac_v1.list_namespaced_role(namespace)
        result = [{"name": role.metadata.name} for role in roles.items]
        return result
  • tools/role.py:8-8 (registration)
    The @mcp.tool() decorator registers the role_list function as an MCP tool.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it's a list operation, implying read-only behavior, but doesn't clarify aspects like whether it requires specific permissions, how it handles errors, or if it returns paginated results. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 sized and front-loaded, with the core purpose stated first followed by parameter and return explanations. Every sentence adds value, though the structure could be slightly improved by integrating parameter details more seamlessly rather than as a separate 'Args' section.

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?

Given the tool's low complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the purpose and parameters but lacks details on usage guidelines, behavioral traits, and output specifics (e.g., what 'basic information' includes). For a read operation with no annotations, more context would be beneficial.

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 description must compensate. It adds meaning by explaining that 'context_name' is the Kubernetes context name and 'namespace' is the Kubernetes namespace, which clarifies the parameters beyond their titles. However, it doesn't provide details like format examples or constraints, leaving some ambiguity.

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 Roles in a given namespace'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'role_get' or 'clusterrole_list', which would require mentioning it returns basic information for multiple roles rather than detailed single-role data or cluster-wide roles.

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. The description doesn't mention sibling tools like 'role_get' (for single role details) or 'clusterrole_list' (for cluster-wide roles), nor does it specify prerequisites such as needing proper Kubernetes access. This leaves the agent without context for tool selection.

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