update_group
Modify Keycloak group details like name, path, or attributes to manage user access and permissions.
Instructions
Update a group.
Args:
group_id: Group ID
name: New group name
path: New group path
attributes: New group attributes
realm: Target realm (uses default if not specified)
Returns:
Status message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_id | Yes | ||
| name | No | ||
| path | No | ||
| attributes | No | ||
| realm | No |
Implementation Reference
- src/tools/group_tools.py:84-121 (handler)The primary handler for the 'update_group' MCP tool. Decorated with @mcp.tool() for automatic registration and schema inference from type hints and documentation. Executes partial updates to a Keycloak group by fetching current state and applying changes via API calls.@mcp.tool() async def update_group( group_id: str, name: Optional[str] = None, path: Optional[str] = None, attributes: Optional[Dict[str, List[str]]] = None, realm: Optional[str] = None, ) -> Dict[str, str]: """ Update a group. Args: group_id: Group ID name: New group name path: New group path attributes: New group attributes realm: Target realm (uses default if not specified) Returns: Status message """ # Get current group current_group = await client._make_request( "GET", f"/groups/{group_id}", realm=realm ) # Update only provided fields if name is not None: current_group["name"] = name if path is not None: current_group["path"] = path if attributes is not None: current_group["attributes"] = attributes await client._make_request( "PUT", f"/groups/{group_id}", data=current_group, realm=realm ) return {"status": "updated", "message": f"Group {group_id} updated successfully"}