Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

add_realm_default_group

Assign a default group to a Keycloak realm to automatically apply group settings to new users, simplifying user management and access control configuration.

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function decorated with @mcp.tool(), which registers and implements the tool logic. It calls the Keycloak API to add a group as a default group for the realm.
    @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"}
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is 'Add' (implying a mutation) and mentions a return value ('Status message'), but lacks critical details: whether this requires admin permissions, if it's idempotent, what happens if the group is already a default, or any rate limits. The description is insufficient for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by clear Arg/Returns sections. Every sentence earns its place with no redundant information, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 parameters with 0% schema coverage and no annotations, the description provides basic parameter semantics and mentions a return value. However, as a mutation tool, it lacks critical behavioral context (permissions, idempotency, side effects). The presence of an output schema (implied by 'Has output schema: true') means the description doesn't need to detail return values, but overall completeness is moderate due to missing mutation-specific guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description adds basic semantics: 'group_id' is the 'Group ID to add as default' and 'realm' is the 'Target realm (uses default if not specified)'. This clarifies purpose but lacks format details (e.g., ID format, realm naming conventions). It compensates partially but not fully for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add') and resource ('default group to the realm'), making the purpose immediately understandable. It distinguishes from siblings like 'remove_realm_default_group' by specifying the opposite operation, though it doesn't explicitly contrast with similar tools like 'create_group' or 'add_user_to_group'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing group), exclusions, or compare it to sibling tools like 'create_group' (for creating new groups) or 'add_user_to_group' (for adding users to groups).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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