Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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"}
  • The @mcp.tool() decorator registers the create_group function as an MCP tool.
    @mcp.tool()
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 creates a new group but doesn't explain what 'create' entails (e.g., permissions required, whether it's idempotent, side effects, or error conditions). This is a significant gap 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 appropriately sized and structured with clear sections (Args, Returns). It's front-loaded with the core purpose, and each sentence adds value without redundancy. However, the parameter explanations could be more detailed to improve utility.

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 (4 parameters, mutation operation) and the presence of an output schema (which handles return values), the description is minimally complete. It covers the purpose and parameters but lacks behavioral context and usage guidelines, making it adequate but with clear gaps for an agent to use effectively.

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?

The description lists all 4 parameters with brief explanations, but schema description coverage is 0%, so the schema provides no additional details. The parameter explanations are minimal (e.g., 'Group name' for 'name'), adding some semantics but not fully compensating for the lack of schema descriptions. This meets the baseline for adequate but incomplete coverage.

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 ('Create a new group') with the resource ('group'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from sibling tools like 'add_realm_default_group' or 'update_group', which also involve group operations, so it doesn't reach the highest score.

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, when-not-to-use scenarios, or compare to sibling tools like 'add_realm_default_group' or 'update_group', leaving the agent without contextual usage information.

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