Skip to main content
Glama

delete_user

Remove a user from the MCP Keycloak server by specifying their user ID and optional realm. Ensures identity and access management cleanup with a clear status response.

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
realmNo
user_idYes

Implementation Reference

  • The delete_user tool handler, decorated with @mcp.tool() for registration. It deletes the specified user via the Keycloak client by sending a DELETE request to the /users/{user_id} endpoint and returns a success message.
    @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"}

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