feat: add update_issue_comment tool#2086
Open
lihuanshuai wants to merge 2 commits intogithub:mainfrom
Open
Conversation
- Add UpdateIssueComment in pkg/github/issues.go: new tool to update an existing issue or PR comment by comment_id (owner, repo, comment_id, body) - Register UpdateIssueComment in pkg/github/tools.go under issues toolset - Document update_issue_comment in README.md Issues section - Uses GitHub REST Issues.EditComment; comment_id from issue_read get_comments or add_issue_comment response
- Add unit test for UpdateIssueComment tool in pkg/github/issues_test.go to verify functionality and input validation. - Introduce a snapshot file for UpdateIssueComment tool to document expected behavior and input schema. - Include new PATCH endpoint constant for updating issue comments in pkg/github/helper_test.go.
45cb759 to
4995ca8
Compare
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.
Summary
Adds
update_issue_commentMCP tool to update an existing issue or pull request comment bycomment_id(owner, repo, comment_id, body). Uses GitHub RESTIssues.EditComment.Why
Allows agents to edit a comment they or the user previously posted (e.g. to correct content or add a follow-up without creating a new comment).
What changed
UpdateIssueCommentinpkg/github/issues.go(tool handler, schema, repo scope).UpdateIssueCommentinpkg/github/tools.gounder the issues toolset.update_issue_commentin README.md (Issues section).PatchReposIssuesCommentsByOwnerByRepoByCommentIDinpkg/github/helper_test.gofor tests.Test_UpdateIssueCommentinpkg/github/issues_test.go(schema checks, success + missing-body cases).pkg/github/__toolsnaps__/update_issue_comment.snap(fromtoolsnaps.Test).MCP impact
update_issue_comment— updates an issue/PR comment by comment ID (fromissue_readget_comments oradd_issue_commentresponse). Same OAuth scope asadd_issue_comment(repo).Prompts tested (tool changes only)
Security / limits
reposcope; only comment author (or users with write access) can update comments via GitHub API.Tool renaming
Lint & tests
./script/test(includingTest_UpdateIssueComment)../script/lint(can be run in CI).Docs
update_issue_commentparameters and description.