Skip to main content
Glama

add_realm_default_group

Assign a default group to a realm in Keycloak by specifying the group ID and optional target realm. Simplifies group management within identity and access systems.

Instructions

Add a default group to the realm. Args: group_id: Group ID to add as default realm: Target realm (uses default if not specified) Returns: Status message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_idYes
realmNo

Implementation Reference

  • The main handler function for the 'add_realm_default_group' tool. It uses the KeycloakClient to add a group as default via PUT /default-groups/{group_id}. The @mcp.tool() decorator registers it as an MCP tool and infers schema from signature/docstring.
    @mcp.tool() async def add_realm_default_group( group_id: str, realm: Optional[str] = None ) -> Dict[str, str]: """ Add a default group to the realm. Args: group_id: Group ID to add as default realm: Target realm (uses default if not specified) Returns: Status message """ await client._make_request("PUT", f"/default-groups/{group_id}", realm=realm) return {"status": "added", "message": f"Group {group_id} added as default group"}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/idoyudha/mcp-keycloak'

If you have feedback or need assistance with the MCP directory API, please join our Discord server