update_current_user
Update the profile of the currently authenticated user by providing updated user information within the MCP Server for Coroot, ensuring accurate account management and observability integration.
Instructions
Update current user information.
Updates the profile of the currently authenticated user.
Args: user_data: Updated user information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_data | Yes |
Implementation Reference
- src/mcp_coroot/server.py:1603-1613 (registration)MCP tool registration for 'update_current_user' using @mcp.tool() decorator. This is the entry point handler for the MCP tool.@mcp.tool() async def update_current_user(user_data: dict[str, Any]) -> dict[str, Any]: """Update current user information. Updates the profile of the currently authenticated user. Args: user_data: Updated user information """ return await update_current_user_impl(user_data) # type: ignore[no-any-return]
- src/mcp_coroot/server.py:1592-1601 (handler)Server-side implementation wrapper that calls the client method and formats the response with error handling.@handle_errors async def update_current_user_impl(user_data: dict[str, Any]) -> dict[str, Any]: """Update current user.""" result = await get_client().update_current_user(user_data) return { "success": True, "message": "User updated successfully", "user": result, }
- src/mcp_coroot/client.py:1255-1271 (handler)Core handler implementation in CorootClient that performs the actual HTTP POST request to the Coroot API endpoint /api/user to update the current user.async def update_current_user(self, user_data: dict[str, Any]) -> dict[str, Any]: """Update current user information. Args: user_data: User data to update. For password change: {"old_password": "current", "new_password": "new"} Returns: Updated user information. """ response = await self._request( "POST", "/api/user", json=user_data, ) data: dict[str, Any] = response.json() return data