Skip to content

feat: add update_issue_comment tool - #3284

Merged
timrogers merged 3 commits into
github:mainfrom
timrogers:feat/update-issue-comment
Sep 15, 2026
Merged

timrogers merged 3 commits into
github:mainfrom
timrogers:feat/update-issue-comment

Conversation

@timrogers

Copy link
Copy Markdown
Contributor

Summary

Adds an update_issue_comment MCP tool that replaces the body of an existing issue or pull request comment and returns the standard minimal ID/URL response.

Why

Agents can currently create issue comments but cannot correct or revise them through the MCP server.

Fixes #1083

What changed

  • Added and registered update_issue_comment using the GitHub REST Issues.EditComment API.
  • Added positive comment ID and non-empty body validation, public-repository write-scope behavior, and consistent API error handling.
  • Added schema snapshots, handler and scope tests, and generated README documentation.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

The new tool accepts owner, repo, comment_id, and body. The REST endpoint identifies the target comment directly, so an issue number is not required.

Prompts tested (tool changes only)

  • "Update issue comment 456 in owner/repo to say: Updated comment" — replaces an existing issue or pull request comment body.
  • "Correct my comment with ID 456 in owner/repo" — exercises validation and the update response path.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

The tool uses the same repository/public-repository write-scope behavior as add_issue_comment; GitHub continues to enforce comment-edit permissions.

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

Add an issues tool for replacing the body of an existing issue or pull request comment, with schema, scope, behavioral, snapshot, and generated documentation coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9acf9c83-49aa-41af-a42d-ad75de34d132
Copilot AI balanced review requested due to automatic review settings September 15, 2026 16:11
@timrogers
timrogers requested a review from a team as a code owner September 15, 2026 16:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@timrogers
timrogers requested a balanced review from Copilot September 15, 2026 16:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Register nil-safe response body cleanup before handling go-github errors from issue comment updates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9acf9c83-49aa-41af-a42d-ad75de34d132

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Empty bodies bypass runtime validation, and the documentation ambiguously includes pull request review comments.

Get a fresh assessment by requesting another Copilot review.

Review tier: Balanced (auto)
Findings: 1 Medium severity · 1 Low severity

Note

Copilot is running an experiment and ran this review at Balanced.

Open (2)

Comment thread pkg/github/issues.go Outdated
Comment thread pkg/github/issues.go Outdated
Comment thread pkg/github/issues.go Outdated
Reject explicitly empty comment bodies at runtime and distinguish issue and pull request conversation comments from pull request review comments in the tool schema and generated docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9acf9c83-49aa-41af-a42d-ad75de34d132

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation, validation, scope handling, documentation, snapshots, and tests are consistent and complete.

Review tier: Balanced (auto)
Findings: None

Note

Copilot is running an experiment and ran this review at Balanced.

Resolved since last review (2)

@timrogers
timrogers merged commit c71961c into github:main Sep 15, 2026
16 checks passed
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_issue_comment tool

3 participants