create_group
Create a new group in Keycloak with specified name, path, attributes, and target realm for identity and access management.
Instructions
Create a new group.
Args:
name: Group name
path: Group path
attributes: Group attributes
realm: Target realm (uses default if not specified)
Returns:
Status message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| path | No | ||
| attributes | No | ||
| realm | No |
Implementation Reference
- src/tools/group_tools.py:54-82 (handler)Implementation of the create_group tool handler. Decorated with @mcp.tool() which registers it as an MCP tool. Handles creating a new group in Keycloak by posting group data via KeycloakClient.@mcp.tool() async def create_group( name: str, path: Optional[str] = None, attributes: Optional[Dict[str, List[str]]] = None, realm: Optional[str] = None, ) -> Dict[str, str]: """ Create a new group. Args: name: Group name path: Group path attributes: Group attributes realm: Target realm (uses default if not specified) Returns: Status message """ group_data = {"name": name} if path: group_data["path"] = path if attributes: group_data["attributes"] = attributes await client._make_request("POST", "/groups", data=group_data, realm=realm) return {"status": "created", "message": f"Group {name} created successfully"}
- src/tools/group_tools.py:54-54 (registration)The @mcp.tool() decorator registers the create_group function as an MCP tool.@mcp.tool()