get_client_by_clientid
Retrieve a specific client configuration from Keycloak identity management using its unique client ID. Specify the realm to access client details for authentication and authorization setup.
Instructions
Get a specific client by client ID.
Args:
client_id: The client's client_id
realm: Target realm (uses default if not specified)
Returns:
Client object
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client_id | Yes | ||
| realm | No |
Implementation Reference
- src/tools/client_tools.py:58-80 (handler)The handler function implementing the get_client_by_clientid tool. It is decorated with @mcp.tool() which registers it. Queries Keycloak /clients endpoint filtered by clientId, iterates to find exact match, returns the client dict or raises Exception.@mcp.tool() async def get_client_by_clientid( client_id: str, realm: Optional[str] = None ) -> Dict[str, Any]: """ Get a specific client by client ID. Args: client_id: The client's client_id realm: Target realm (uses default if not specified) Returns: Client object """ clients = await client._make_request( "GET", "/clients", params={"clientId": client_id}, realm=realm ) if clients and len(clients) > 0: # Find exact match for c in clients: if c.get("clientId") == client_id: return c raise Exception(f"Client with client_id '{client_id}' not found")