Skip to main content
Glama

reset_user_password

Reset a user's password in the mcp-keycloak server using the user ID and new password. Optionally set the password as temporary, requiring the user to change it on next login. Specify the target realm if needed.

Instructions

Reset a user's password. Args: user_id: The user's ID password: New password temporary: Whether the password is temporary (user must change on next login) realm: Target realm (uses default if not specified) Returns: Status message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
passwordYes
realmNo
temporaryNo
user_idYes

Implementation Reference

  • The main handler function for the 'reset_user_password' tool, decorated with @mcp.tool() for registration. It resets the user's password via Keycloak API.
    @mcp.tool() async def reset_user_password( user_id: str, password: str, temporary: bool = True, realm: Optional[str] = None ) -> Dict[str, str]: """ Reset a user's password. Args: user_id: The user's ID password: New password temporary: Whether the password is temporary (user must change on next login) realm: Target realm (uses default if not specified) Returns: Status message """ credential_data = {"type": "password", "value": password, "temporary": temporary} await client._make_request( "PUT", f"/users/{user_id}/reset-password", data=credential_data, realm=realm ) return {"status": "success", "message": f"Password reset for user {user_id}"}

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