Add delete_comment tool #22

Open
opened 2026-04-28 14:17:33 +00:00 by jbr870 · 0 comments
Owner

Summary

Add a delete_comment tool that wraps DELETE /repos/{owner}/{repo}/issues/comments/{id}.

Background

The Forgejo API supports comment deletion via the standard Gitea-inherited endpoint, but the MCP server does not currently wrap it. Today, once a comment is created, the only mutation tool available is edit_comment — there is no way to remove a comment via MCP.

This is a lower-stakes gap than delete_issue (#21): comments are routinely deleted (typos, wrong thread, off-topic) and the operation is far less consequential than removing an entire issue.

Proposed signature

delete_comment(owner: str, repo: str, comment_id: int, instance: str | None = None) -> dict

comment_id is the global comment ID (the id field returned by create_comment and list_issue_comments), not an issue-scoped index — consistent with how edit_comment already addresses comments.

Return shape: {"result": {"deleted": true, "comment_id": N}} on success, {"error": "..."} on failure.

Notes

  • The Forgejo backend uses a commentAssignment() middleware (forgejo/forgejo#2126) that verifies the comment ID belongs to the addressed repository, so the upstream already returns clean error envelopes for cross-repo / non-existent IDs. The MCP wrapper should propagate those as the standard {"error": ...} shape.
  • Pairs naturally with #21 to make the regression test prompt fully idempotent.
  • Companion: #21 (delete_issue)
  • Caller of this gap: regression test prompt
## Summary Add a `delete_comment` tool that wraps `DELETE /repos/{owner}/{repo}/issues/comments/{id}`. ## Background The Forgejo API supports comment deletion via the standard Gitea-inherited endpoint, but the MCP server does not currently wrap it. Today, once a comment is created, the only mutation tool available is `edit_comment` — there is no way to remove a comment via MCP. This is a lower-stakes gap than `delete_issue` (#21): comments are routinely deleted (typos, wrong thread, off-topic) and the operation is far less consequential than removing an entire issue. ## Proposed signature ``` delete_comment(owner: str, repo: str, comment_id: int, instance: str | None = None) -> dict ``` `comment_id` is the global comment ID (the `id` field returned by `create_comment` and `list_issue_comments`), not an issue-scoped index — consistent with how `edit_comment` already addresses comments. Return shape: `{"result": {"deleted": true, "comment_id": N}}` on success, `{"error": "..."}` on failure. ## Notes - The Forgejo backend uses a `commentAssignment()` middleware (forgejo/forgejo#2126) that verifies the comment ID belongs to the addressed repository, so the upstream already returns clean error envelopes for cross-repo / non-existent IDs. The MCP wrapper should propagate those as the standard `{"error": ...}` shape. - Pairs naturally with #21 to make the regression test prompt fully idempotent. ## Related - Companion: #21 (delete_issue) - Caller of this gap: regression test prompt
Sign in to join this conversation.
No labels
status/paused
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jbr870/forgejo-mcp-server#22
No description provided.