Skip to main content
Glama

list_clients

Retrieve and filter client details in a Keycloak realm by ID, visibility, or pagination. Use offsets and limits to manage large datasets efficiently.

Instructions

List clients in the realm. Args: client_id: Filter by client ID (partial match) viewable_only: Only return viewable clients first: Pagination offset max: Maximum results size realm: Target realm (uses default if not specified) Returns: List of client objects

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
client_idNo
firstNo
maxNo
realmNo
viewable_onlyNo

Implementation Reference

  • Handler function for the 'list_clients' tool, decorated with @mcp.tool() for automatic registration. Implements listing clients from Keycloak with filtering and pagination parameters using KeycloakClient._make_request.
    @mcp.tool() async def list_clients( client_id: Optional[str] = None, viewable_only: bool = False, first: Optional[int] = None, max: Optional[int] = None, realm: Optional[str] = None, ) -> List[Dict[str, Any]]: """ List clients in the realm. Args: client_id: Filter by client ID (partial match) viewable_only: Only return viewable clients first: Pagination offset max: Maximum results size realm: Target realm (uses default if not specified) Returns: List of client objects """ params = {} if client_id: params["clientId"] = client_id if viewable_only: params["viewableOnly"] = "true" if first is not None: params["first"] = first if max is not None: params["max"] = max return await client._make_request("GET", "/clients", params=params, realm=realm)
  • The @mcp.tool() decorator registers the list_clients function as an MCP tool.
    @mcp.tool()
  • Function signature defines input schema (parameters with types and defaults) and output schema (return type annotation).
    async def list_clients( client_id: Optional[str] = None, viewable_only: bool = False, first: Optional[int] = None, max: Optional[int] = None, realm: Optional[str] = None, ) -> List[Dict[str, Any]]:

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