get_user
Retrieve detailed user information by specifying a user ID and optional realm within the Keycloak identity management system.
Instructions
Get a specific user by ID.
Args:
user_id: The user's ID
realm: Target realm (uses default if not specified)
Returns:
User object
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| realm | No | ||
| user_id | Yes |
Implementation Reference
- src/tools/user_tools.py:51-63 (handler)The handler function for the 'get_user' MCP tool. It is decorated with @mcp.tool() which registers it, retrieves user details from Keycloak API using the provided user_id and optional realm.@mcp.tool() async def get_user(user_id: str, realm: Optional[str] = None) -> Dict[str, Any]: """ Get a specific user by ID. Args: user_id: The user's ID realm: Target realm (uses default if not specified) Returns: User object """ return await client._make_request("GET", f"/users/{user_id}", realm=realm)