Skip to content

feat: add update_issue_comment tool#2086

Open
lihuanshuai wants to merge 2 commits intogithub:mainfrom
lihuanshuai:feat/update-issue-comment
Open

feat: add update_issue_comment tool#2086
lihuanshuai wants to merge 2 commits intogithub:mainfrom
lihuanshuai:feat/update-issue-comment

Conversation

@lihuanshuai
Copy link

@lihuanshuai lihuanshuai commented Feb 25, 2026

Summary

Adds update_issue_comment MCP tool to update an existing issue or pull request comment by comment_id (owner, repo, comment_id, body). Uses GitHub REST Issues.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

  • Added UpdateIssueComment in pkg/github/issues.go (tool handler, schema, repo scope).
  • Registered UpdateIssueComment in pkg/github/tools.go under the issues toolset.
  • Documented update_issue_comment in README.md (Issues section).
  • Added PatchReposIssuesCommentsByOwnerByRepoByCommentID in pkg/github/helper_test.go for tests.
  • Added Test_UpdateIssueComment in pkg/github/issues_test.go (schema checks, success + missing-body cases).
  • Tool snapshot pkg/github/__toolsnaps__/update_issue_comment.snap (from toolsnaps.Test).

MCP impact

  • New tool added: update_issue_comment — updates an issue/PR comment by comment ID (from issue_read get_comments or add_issue_comment response). Same OAuth scope as add_issue_comment (repo).

Prompts tested (tool changes only)

  • "Update comment 123456 on owner/repo to say: Updated text." (edit existing comment)
  • "Change my last comment on issue [docker] build arm64 #42 in owner/repo to: Corrected explanation." (agent gets comment_id from get_comments then calls update_issue_comment)

Security / limits

  • Auth / permissions considered: Uses existing repo scope; only comment author (or users with write access) can update comments via GitHub API.

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Tested locally with ./script/test (including Test_UpdateIssueComment).
  • Linted locally with ./script/lint (can be run in CI).

Docs

  • Updated README.md Issues section with update_issue_comment parameters and description.

@lihuanshuai lihuanshuai requested a review from a team as a code owner February 25, 2026 11:08
- 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.
@lihuanshuai lihuanshuai force-pushed the feat/update-issue-comment branch from 45cb759 to 4995ca8 Compare February 25, 2026 11:13
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.

1 participant