Assign a realm role to a group
keycloak_group_role_assignGrants a specified realm role to a group, so all its members inherit the role. Idempotent; reassigning an already-granted role has no effect.
Instructions
Write operation. Grants an existing realm role to a group, so the group's members inherit that role. Idempotent: re-assigning an already-granted role makes no further change. Resolve the group ID with keycloak_group_list and ensure the realm role exists beforehand. Returns a message stating the role was assigned, or, if it could not be, that it was not assigned with the reason.
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": {
"groupId": "<groupId>",
"role": "<role>"
},
"name": "keycloak_group_role_assign"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | Yes | Name of an existing realm role to assign, e.g. "admin". Must match an existing realm role name exactly. | |
| groupId | Yes | ID of the group to grant the role to (the group's UUID from keycloak_group_list). |