Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

get_group_members

Retrieve members of a Keycloak group to manage access control and permissions. Supports pagination and realm specification for efficient user management.

Instructions

Get members of a group.

Args:
    group_id: Group ID
    first: Pagination offset
    max: Maximum results size
    realm: Target realm (uses default if not specified)

Returns:
    List of group members

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_idYes
firstNo
maxNo
realmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_group_members' tool. It is decorated with @mcp.tool() which registers it as an MCP tool. The function fetches members of a specified group from Keycloak using the KeycloakClient, supporting pagination and realm specification. The docstring provides the input schema description.
    @mcp.tool()
    async def get_group_members(
        group_id: str,
        first: Optional[int] = None,
        max: Optional[int] = None,
        realm: Optional[str] = None,
    ) -> List[Dict[str, Any]]:
        """
        Get members of a group.
    
        Args:
            group_id: Group ID
            first: Pagination offset
            max: Maximum results size
            realm: Target realm (uses default if not specified)
    
        Returns:
            List of group members
        """
        params = {}
        if first is not None:
            params["first"] = first
        if max is not None:
            params["max"] = max
    
        return await client._make_request(
            "GET", f"/groups/{group_id}/members", params=params, realm=realm
        )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions pagination parameters ('first' and 'max') which implies pagination behavior, but doesn't describe return format details, error conditions, authentication requirements, rate limits, or whether this is a read-only operation. The description is minimal and leaves significant behavioral aspects unspecified.

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 efficiently structured with a clear purpose statement followed by parameter and return value sections. Every sentence serves a purpose, though the 'Args' and 'Returns' labels could be more naturally integrated. The information is front-loaded with the core purpose stated first.

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 has 4 parameters (1 required), no annotations, and an output schema exists (so return values don't need description), the description is moderately complete. It covers parameter semantics well but lacks behavioral context, usage guidelines, and doesn't address the tool's relationship to sibling operations. For a read operation with pagination, more guidance would be helpful.

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 clear semantic explanations for all 4 parameters beyond what the schema offers (0% coverage). It explains that 'group_id' identifies the target group, 'first' is a pagination offset, 'max' controls result size, and 'realm' specifies the target realm with default behavior. This adds substantial value over the bare schema.

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 tool's purpose with 'Get members of a group' - a specific verb ('Get') and resource ('members of a group'). It distinguishes from siblings like 'get_group' (which retrieves group metadata) or 'list_groups' (which lists groups themselves), but doesn't explicitly mention these distinctions in the description text itself.

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 related tools like 'get_user_groups' (which gets groups for a user) or 'list_users' (which might overlap in functionality), nor does it specify prerequisites or appropriate contexts for use.

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