Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

delete_user

Remove a user account from Keycloak identity management by specifying the user ID and optional realm to maintain system security and access control.

Instructions

Delete a user.

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

Returns:
    Status message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes
realmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'delete_user' tool. It is decorated with @mcp.tool() which likely registers it as an MCP tool. The function deletes the specified user from the Keycloak realm using the KeycloakClient.
    @mcp.tool()
    async def delete_user(user_id: str, realm: Optional[str] = None) -> Dict[str, str]:
        """
        Delete a user.
    
        Args:
            user_id: The user's ID
            realm: Target realm (uses default if not specified)
    
        Returns:
            Status message
        """
        await client._make_request("DELETE", f"/users/{user_id}", realm=realm)
        return {"status": "deleted", "message": f"User {user_id} deleted successfully"}
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 states the action is 'Delete' which implies a destructive, irreversible operation, but doesn't specify permission requirements, whether it's synchronous/asynchronous, what happens to user data, or error conditions. The mention of 'Returns: Status message' is minimal behavioral information.

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 brief with clear sectioning (Args, Returns). The purpose statement is front-loaded. However, the 'Returns: Status message' section is overly vague and could be more informative without sacrificing conciseness.

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?

For a destructive operation with 2 parameters and no annotations, the description provides basic purpose and parameter semantics. The existence of an output schema means return values don't need explanation. However, significant gaps remain regarding usage context, behavioral details, and parameter constraints that are important for a deletion tool.

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 provides basic semantic meaning for both parameters ('user_id: The user's ID' and 'realm: Target realm (uses default if not specified)'), which adds value beyond the bare schema. However, it doesn't explain format requirements, realm implications, or what 'default' means contextually.

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 ('Delete') and resource ('a user'), making the purpose immediately understandable. It distinguishes itself from siblings like 'remove_user_from_group' or 'logout_user' by specifying permanent user deletion. However, it doesn't explicitly contrast with other destructive operations like 'delete_client' or 'delete_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?

No guidance is provided about when to use this tool versus alternatives like 'remove_user_from_group' or 'logout_user'. The description doesn't mention prerequisites (e.g., user must exist), consequences (e.g., irreversible), or appropriate contexts for deletion versus other user management operations.

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