Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

list_realm_roles

Retrieve and manage realm roles in Keycloak with pagination, search, and filtering options for identity and access management.

Instructions

List all realm roles.

Args:
    first: Pagination offset
    max: Maximum results size
    search: Search string
    realm: Target realm (uses default if not specified)

Returns:
    List of realm roles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
firstNo
maxNo
searchNo
realmNo

Implementation Reference

  • The main handler function for the 'list_realm_roles' MCP tool. It is decorated with @mcp.tool() for automatic registration and uses KeycloakClient to fetch realm roles with optional pagination and search parameters.
    @mcp.tool()
    async def list_realm_roles(
        first: Optional[int] = None,
        max: Optional[int] = None,
        search: Optional[str] = None,
        realm: Optional[str] = None,
    ) -> List[Dict[str, Any]]:
        """
        List all realm roles.
    
        Args:
            first: Pagination offset
            max: Maximum results size
            search: Search string
            realm: Target realm (uses default if not specified)
    
        Returns:
            List of realm roles
        """
        params = {}
        if first is not None:
            params["first"] = first
        if max is not None:
            params["max"] = max
        if search:
            params["search"] = search
    
        return await client._make_request("GET", "/roles", params=params, realm=realm)

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