Skip to main content
Glama

list_client_roles

Retrieve roles for a specific client using pagination, search, and realm parameters to manage access in Keycloak identity systems efficiently.

Instructions

List roles for a specific client. Args: client_id: Client database ID first: Pagination offset max: Maximum results size search: Search string realm: Target realm (uses default if not specified) Returns: List of client roles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
client_idYes
firstNo
maxNo
realmNo
searchNo

Implementation Reference

  • The handler function for list_client_roles tool. It is decorated with @mcp.tool() which registers it as an MCP tool. The function fetches client roles from Keycloak using the KeycloakClient instance.
    @mcp.tool() async def list_client_roles( client_id: str, first: Optional[int] = None, max: Optional[int] = None, search: Optional[str] = None, realm: Optional[str] = None, ) -> List[Dict[str, Any]]: """ List roles for a specific client. Args: client_id: Client database ID first: Pagination offset max: Maximum results size search: Search string realm: Target realm (uses default if not specified) Returns: List of client 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", f"/clients/{client_id}/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