keycloak_get_user_role_mappings
Retrieve a Keycloak user's role mappings, showing direct roles by default or all effective roles when requested.
Instructions
Get a user's role mappings. By default returns only roles assigned DIRECTLY to the user; set effective to also include roles inherited from groups and from composite roles — that is the set that actually lands in their token.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"userId": "<userId>"
},
"name": "keycloak_get_user_role_mappings"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| realm | No | Realm to operate on. Defaults to the server's configured realm (KEYCLOAK_REALM). | |
| userId | Yes | User UUID (the `id` field), NOT the username. Find it with keycloak_list_users. | |
| effective | No | Include roles inherited via groups and composites. |