Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

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
NameRequiredDescriptionDefault
group_idYes
nameNo
pathNo
attributesNo
realmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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"}
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 tool updates a group and returns a status message, but doesn't cover critical aspects like required permissions, whether changes are destructive or reversible, error handling, or rate limits. This is inadequate 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.

Conciseness4/5

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

The description is well-structured with clear 'Args' and 'Returns' sections, and each sentence is necessary. It's front-loaded with the purpose, though slightly verbose in listing all parameters individually. No wasted text, but could be more concise by grouping parameter explanations.

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 the tool's complexity (mutation with 5 parameters), no annotations, and an output schema (implied by 'Returns: Status message'), the description is moderately complete. It covers parameters and return value, but lacks behavioral context, usage guidelines, and differentiation from siblings, leaving gaps for an AI agent to use it effectively.

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

Parameters4/5

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

The description provides a parameter list with brief explanations (e.g., 'Group ID', 'New group name'), adding meaning beyond the schema which has 0% description coverage. However, it doesn't fully explain complex parameters like 'attributes' (an object with array values) or 'realm' (default behavior). With 5 parameters and low schema coverage, this is helpful but incomplete.

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

Purpose3/5

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

The description states 'Update a group' which clearly indicates the verb (update) and resource (group), but it's generic and doesn't differentiate from sibling tools like 'update_client', 'update_realm_role', or 'update_user'. It lacks specificity about what aspects of a group are updated beyond the parameter list.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing group), compare to 'create_group' for new groups, or specify scenarios where updating is appropriate. The description only lists parameters without contextual usage advice.

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