update_comment
Modify existing comments on OpenProject activities by providing the activity ID, updated markdown text, and current lock version to maintain data integrity.
Instructions
Update an existing comment.
Args:
activity_id: Activity ID of the comment to update
comment: New comment text in markdown format
lock_version: Current lock version (get from activity first)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activity_id | Yes | ||
| comment | Yes | ||
| lock_version | Yes |
Implementation Reference
- src/openproject_mcp/server.py:244-257 (handler)MCP tool handler and registration for 'update_comment'. This is the entry point decorated with @mcp.tool() that handles tool execution by delegating to the comments module implementation.@mcp.tool() async def update_comment(activity_id: int, comment: str, lock_version: int): """Update an existing comment. Args: activity_id: Activity ID of the comment to update comment: New comment text in markdown format lock_version: Current lock version (get from activity first) """ return await comments.update_comment( activity_id=activity_id, comment=comment, lock_version=lock_version, )
- Core implementation of update_comment that performs the PATCH request to the OpenProject API to update the activity/comment.async def update_comment( activity_id: int, comment: str, lock_version: int ) -> dict[str, Any]: """Update an existing comment. Args: activity_id: Activity ID of the comment to update comment: New comment text in markdown format lock_version: Current lock version (get from activity first) Returns: Updated activity object """ client = OpenProjectClient() try: payload = { "comment": build_formattable(comment), "lockVersion": lock_version, } result = await client.patch(f"activities/{activity_id}", data=payload) return result finally: await client.close()