Skip to content

feat: consolidate PR review comment writes into pull_request_comment_write#2673

Open
brs191 wants to merge 1 commit into
github:mainfrom
brs191:feat-pull-request-comment-write
Open

feat: consolidate PR review comment writes into pull_request_comment_write#2673
brs191 wants to merge 1 commit into
github:mainfrom
brs191:feat-pull-request-comment-write

Conversation

@brs191

@brs191 brs191 commented Jun 11, 2026

Copy link
Copy Markdown

Resolves #2448

What

Replaces add_reply_to_pull_request_comment with a consolidated pull_request_comment_write tool supporting three methods:

  • reply — add a reply to an existing review comment (identical behavior to the old tool)
  • update — replace the body of a review comment (PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id})
  • delete — delete a review comment (DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id})

Why a consolidated tool instead of the two tools proposed in #2448

  • Follows the established pattern of discussion_comment_write and pull_request_review_write (method-parameter write tools).
  • Keeps the default tool count flat: one tool replaced by one tool, instead of net +2.
  • add_reply_to_pull_request_comment is preserved via a deprecation alias per docs/tool-renaming.md, so existing --tools / X-MCP-Tools configurations keep working.

Use case (from #2448)

When an agent needs to correct or retract a review comment it previously posted, the only mutation available today is adding a new reply — leaving the stale original visible and creating thread noise. The workaround is gh api with PATCH/DELETE, bypassing the MCP server. With this change agents can clean up their own review comments programmatically.

Testing

  • go test ./... — full suite passes
  • UPDATE_TOOLSNAPS=true go test ./pkg/github/ — snapshot regenerated
  • script/generate-docs — README + tool-renaming docs regenerated
  • golangci-lint run (v2.9.0) — 0 issues
  • 14 unit test cases: success paths for all three methods, required-parameter validation per method, and API error mapping (403 on updating another user's comment, 404 on deleting a non-existent comment)

…write

Replaces add_reply_to_pull_request_comment with a consolidated
pull_request_comment_write tool supporting three methods:

- reply: add a reply to an existing review comment (existing behavior)
- update: edit the body of a review comment (PATCH /repos/{owner}/{repo}/pulls/comments/{id})
- delete: remove a review comment (DELETE /repos/{owner}/{repo}/pulls/comments/{id})

A deprecation alias maps add_reply_to_pull_request_comment to the new
tool so existing configurations keep working.

Closes github#2448
@brs191 brs191 requested a review from a team as a code owner June 11, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add update_pull_request_comment and delete_pull_request_comment tools

1 participant