Skip to main content
Glama

clusterrole_get

Retrieve detailed information about a specific ClusterRole in Kubernetes by providing the context name and ClusterRole name. Facilitates efficient management of ClusterRoles across multiple clusters using the k8s-pilot MCP server.

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

  • Full implementation of the clusterrole_get tool handler, including decorators for registration and context. Fetches ClusterRole details via Kubernetes RBAC API.
    @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] }
  • tools/role.py:136-136 (registration)
    Tool registration via @mcp.tool() decorator.
    @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