feat: consolidate PR review comment writes into pull_request_comment_write#2673
Open
brs191 wants to merge 1 commit into
Open
feat: consolidate PR review comment writes into pull_request_comment_write#2673brs191 wants to merge 1 commit into
brs191 wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #2448
What
Replaces
add_reply_to_pull_request_commentwith a consolidatedpull_request_comment_writetool 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
discussion_comment_writeandpull_request_review_write(method-parameter write tools).add_reply_to_pull_request_commentis preserved via a deprecation alias perdocs/tool-renaming.md, so existing--tools/X-MCP-Toolsconfigurations 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 apiwith PATCH/DELETE, bypassing the MCP server. With this change agents can clean up their own review comments programmatically.Testing
go test ./...— full suite passesUPDATE_TOOLSNAPS=true go test ./pkg/github/— snapshot regeneratedscript/generate-docs— README + tool-renaming docs regeneratedgolangci-lint run(v2.9.0) — 0 issues