Skip to main content
Glama

role_get

Retrieve detailed information about a specific Kubernetes Role by specifying the context, namespace, and Role name for effective cluster management.

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
nameYes
namespaceYes

Implementation Reference

  • The implementation of the 'role_get' MCP tool. This function is decorated with @mcp.tool() for registration and retrieves detailed information about a specific Kubernetes Role in a namespace using the RBAC API.
    @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] }

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