Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

get_user

Retrieve a specific user's details by ID from Keycloak identity management, optionally specifying a realm for targeted access.

Instructions

Get a specific user by ID.

Args:
    user_id: The user's ID
    realm: Target realm (uses default if not specified)

Returns:
    User object

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes
realmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler for the 'get_user' MCP tool. It is decorated with @mcp.tool() which registers it with the MCP server using the function name as the tool name. The function retrieves a specific user by ID from the Keycloak realm.
    @mcp.tool()
    async def get_user(user_id: str, realm: Optional[str] = None) -> Dict[str, Any]:
        """
        Get a specific user by ID.
    
        Args:
            user_id: The user's ID
            realm: Target realm (uses default if not specified)
    
        Returns:
            User object
        """
        return await client._make_request("GET", f"/users/{user_id}", realm=realm)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves a user but doesn't cover permissions required, error handling (e.g., invalid ID), rate limits, or whether it's read-only (implied by 'Get' but not explicit). This leaves significant gaps for a tool that likely involves authentication and data access.

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 'Args' and 'Returns' sections. Every sentence earns its place by defining parameters and output without redundancy, making it efficient and easy to parse.

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 no annotations, 2 parameters with 0% schema coverage, and an output schema (which handles return values), the description is partially complete. It covers the basic purpose and parameters but lacks behavioral details like authentication needs or error cases, which are important for a user retrieval tool in this context with many sibling operations.

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 description must compensate. It adds meaning by explaining 'user_id' as 'The user's ID' and 'realm' as 'Target realm (uses default if not specified)', clarifying optionality and default behavior. However, it doesn't detail format constraints (e.g., ID structure) or realm examples, leaving some ambiguity.

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 a specific user by ID', specifying both the verb ('Get') and resource ('user'), and distinguishes it from siblings like 'list_users' by focusing on retrieval of a single user. However, it doesn't explicitly differentiate from other user-related tools like 'get_user_groups' or 'get_user_realm_roles' beyond the core action.

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. The description doesn't mention prerequisites (e.g., needing a valid user ID), compare it to 'list_users' for multiple users, or reference other user-retrieval tools like 'get_user_sessions'. Usage is implied by the purpose but lacks explicit context.

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