delete_group
Remove a group from Keycloak identity management by specifying its ID and optional realm to maintain clean access control structures.
Instructions
Delete a group.
Args:
group_id: Group ID
realm: Target realm (uses default if not specified)
Returns:
Status message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_id | Yes | ||
| realm | No |
Implementation Reference
- src/tools/group_tools.py:124-137 (handler)The delete_group tool handler function, decorated with @mcp.tool() for registration. Deletes a Keycloak group by ID using the KeycloakClient and returns a status message.@mcp.tool() async def delete_group(group_id: str, realm: Optional[str] = None) -> Dict[str, str]: """ Delete a group. Args: group_id: Group ID realm: Target realm (uses default if not specified) Returns: Status message """ await client._make_request("DELETE", f"/groups/{group_id}", realm=realm) return {"status": "deleted", "message": f"Group {group_id} deleted successfully"}
- src/tools/group_tools.py:124-124 (registration)Registration of the delete_group tool via the @mcp.tool() decorator.@mcp.tool()