From c123df9b1577f366904668b4e413f9ab12bc85df Mon Sep 17 00:00:00 2001 From: Isaac Johnson Date: Mon, 13 Oct 2025 06:32:59 -0500 Subject: [PATCH] 0.14 - attempt update comment --- Dockerfile | 2 +- gemini-extension.json | 6 +++--- main.py | 29 +++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a1cc2c..3ddf115 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,4 +20,4 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . . CMD ["python", "main.py"] -#harbor.freshbrewed.science/library/vikunjamcp:0.13 \ No newline at end of file +#harbor.freshbrewed.science/library/vikunjamcp:0.14 diff --git a/gemini-extension.json b/gemini-extension.json index e162f36..85b69c4 100644 --- a/gemini-extension.json +++ b/gemini-extension.json @@ -1,6 +1,6 @@ { "name": "vikunja", - "version": "1.0.13", + "version": "1.0.14", "mcpServers": { "nodeServer": { "command": "docker", @@ -14,7 +14,7 @@ "VIKUNJA_USERNAME", "-e", "VIKUNJA_PASSWORD", - "harbor.freshbrewed.science/library/vikunjamcp:0.13" + "harbor.freshbrewed.science/library/vikunjamcp:0.14" ], "env": { "VIKUNJA_URL": "$VIKUNJA_URL", @@ -23,4 +23,4 @@ } } } -} \ No newline at end of file +} diff --git a/main.py b/main.py index bce0ada..8a736a3 100644 --- a/main.py +++ b/main.py @@ -187,6 +187,35 @@ def comment_task(task_id: int, description: str): logger.exception("comment_task: request failed for task_id=%s", task_id) return f"Error adding comment to task: {e}" + + + @mcp.tool() + def update_comment(task_id: int, comment_id: int, comment: str): + """ + Updates an existing comment on a task. + + :param task_id: The ID of the task. + :param comment_id: The ID of the comment to update. + :param comment: The updated comment text. + """ + if "Authorization" not in session.headers: + return "Please run the 'login' command first." + + if not (comment or "").strip(): + return "Comment cannot be empty." + + payload = {"comment": comment} + + try: + response = session.post( + f"{VIKUNJA_URL}/api/v1/tasks/{task_id}/comments/{comment_id}", + json=payload + ) + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + logger.exception("update_comment: request failed for task_id=%s, comment_id=%s", task_id, comment_id) + return f"Error updating comment for task: {e}" @mcp.tool() def lookup_project(): """