Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

get_realm_role

Retrieve a specific realm role by name from Keycloak identity management to manage access permissions and role configurations.

Instructions

Get a specific realm role by name.

Args:
    role_name: Role name
    realm: Target realm (uses default if not specified)

Returns:
    Role object

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
role_nameYes
realmNo

Implementation Reference

  • Handler function for the 'get_realm_role' tool. Decorated with @mcp.tool(), which registers it. Retrieves a specific realm role by name using the KeycloakClient.
    @mcp.tool()
    async def get_realm_role(role_name: str, realm: Optional[str] = None) -> Dict[str, Any]:
        """
        Get a specific realm role by name.
    
        Args:
            role_name: Role name
            realm: Target realm (uses default if not specified)
    
        Returns:
            Role object
        """
        return await client._make_request("GET", f"/roles/{role_name}", realm=realm)
  • The @mcp.tool() decorator registers the get_realm_role 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/idoyudha/mcp-keycloak'

If you have feedback or need assistance with the MCP directory API, please join our Discord server