Skip to main content
Glama

role_list

List all Roles in a specified Kubernetes namespace using the k8s-pilot MCP server. Simplifies role management across multiple clusters by providing basic role information.

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 core handler function for the 'role_list' MCP tool. It lists all Kubernetes Roles in the specified namespace by calling the RBAC API.
    @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()

Other Tools

Related 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