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()

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