Skip to content

Add reaction tools for issues and pull requests#2732

Open
timrogers wants to merge 5 commits into
github:mainfrom
timrogers:timrogers/planning-reaction-tools
Open

Add reaction tools for issues and pull requests#2732
timrogers wants to merge 5 commits into
github:mainfrom
timrogers:timrogers/planning-reaction-tools

Conversation

@timrogers

Copy link
Copy Markdown
Contributor

Summary

Add three new MCP tools that allow clients to add emoji reactions to GitHub issues, issue comments, and pull request review comments. These tools are available in both granular and non-granular modes.

Why

Reactions are a fundamental part of GitHub's interaction model. Clients should be able to add reactions programmatically just as they can create issues, comments, and reviews. This enables workflows where tools can express sentiment or acknowledgment on existing content.

What changed

  • Added add_issue_reaction tool: Add a reaction to an issue
  • Added add_issue_comment_reaction tool: Add a reaction to an issue comment
  • Added add_pull_request_review_comment_reaction tool: Add a reaction to a pull request review comment

Implementation details:

  • Tools follow the same parameter pattern as existing write tools (owner, repo, required ID fields, and a content parameter with enum values for the 8 supported GitHub emoji reactions: +1, -1, laugh, confused, heart, hooray, rocket, eyes)
  • Each tool returns a minimal response with the reaction ID
  • Tools are implemented in existing files: pkg/github/issues_granular.go and pkg/github/pullrequests_granular.go
  • Updated descriptions to align with codebase style: "Add a reaction to [object]."
  • All three tools are available in both granular and non-granular modes (no feature-flag gates)

Verification performed:

  • Confirmed all 8 emoji types match GitHub's official API documentation
  • Verified the three reaction surfaces (issue, issue comment, PR review comment) cover the primary use cases
  • Checked tool descriptions align with existing tool naming patterns
  • Updated toolsnaps to reflect description changes
  • All tests pass; docs regenerated successfully

MCP impact

  • New tool added
    • Three new write tools added that extend existing GitHub write capabilities to reactions, a fundamental interaction model in GitHub

Prompts tested (tool changes only)

  • "Add a reaction to issue 42 in my-repo"
  • "Add a reaction to the issue comment I just made"
  • "Add a reaction to the PR review comment feedback"

Security / limits

  • No security or limits impact
    • Reactions follow existing GitHub API permissions
    • Uses the same client authentication and error handling as other write tools

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

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

Docs

  • Updated (README / docs / examples)
    • README.md tool documentation updated via script/generate-docs
    • Toolsnaps created and updated in pkg/github/__toolsnaps__/

@timrogers timrogers requested a review from a team as a code owner June 19, 2026 16:06
Copilot AI review requested due to automatic review settings June 19, 2026 16:06

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.

Pull request overview

This PR adds three new MCP write tools that let clients create emoji reactions on GitHub issues, issue comments, and pull request review comments, extending the server’s “write” surface area to cover a core GitHub interaction.

Changes:

  • Added three new tools: add_issue_reaction, add_issue_comment_reaction, and add_pull_request_review_comment_reaction.
  • Wired the tools into the global tool inventory and added handler tests with mocked HTTP endpoints.
  • Updated generated documentation and added new tool schema snapshots (__toolsnaps__).
Show a summary per file
File Description
README.md Documents the three new tools and their parameters in the generated tool listing.
pkg/github/tools.go Registers the three new tools in AllTools so they’re available to clients.
pkg/github/issues_granular.go Implements add_issue_reaction and add_issue_comment_reaction tool schemas and handlers.
pkg/github/pullrequests_granular.go Implements add_pull_request_review_comment_reaction tool schema and handler.
pkg/github/helper_test.go Adds mocked endpoint patterns for the reactions REST endpoints.
pkg/github/granular_tools_test.go Adds toolsnap coverage and handler tests for the new reaction tools.
pkg/github/toolsnaps/add_issue_reaction.snap New snapshot for add_issue_reaction tool schema.
pkg/github/toolsnaps/add_issue_comment_reaction.snap New snapshot for add_issue_comment_reaction tool schema.
pkg/github/toolsnaps/add_pull_request_review_comment_reaction.snap New snapshot for add_pull_request_review_comment_reaction tool schema.

Copilot's findings

  • Files reviewed: 9/9 changed files
  • Comments generated: 3

Comment thread pkg/github/issues_granular.go
Comment thread pkg/github/issues_granular.go Outdated
Comment thread pkg/github/pullrequests_granular.go Outdated
timrogers and others added 4 commits June 19, 2026 17:25
Implement three granular-only tools for adding emoji reactions:
- add_issue_reaction: Add reaction to an issue
- add_issue_comment_reaction: Add reaction to an issue comment
- add_pull_request_review_comment_reaction: Add reaction to a PR review comment

All tools are feature-flagged with FeatureFlagEnable set to enable them
only when clients request granular toolsets. Tools use go-github's
Reactions service and return minimal ID response on success (HTTP 201).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove feature flag gates from reaction tools so they're available to all
clients regardless of granular toolset preference. Reaction tools are
naturally atomic operations and work equally well in both modes.

Updates test expectations to exclude reaction tools from granular-only
test assertions, since they're now always available.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@timrogers timrogers force-pushed the timrogers/planning-reaction-tools branch from 44c2a5e to 94c6f2c Compare June 19, 2026 16:26
A-Georgiou
A-Georgiou previously approved these changes Jun 19, 2026

@A-Georgiou A-Georgiou 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.

Looks good to me 🚀

@timrogers

Copy link
Copy Markdown
Contributor Author

Tested manually locally and this is all working. We could consider adding tools to remove reactions, but I think this is a good incremental step and we can choose to add more later.

Return reaction URLs in minimal responses and clarify issue tools apply to pull requests where applicable.

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

@phillipschandler19-web phillipschandler19-web left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

internal/ghmcp/server_test.go.github/actions/build-ui/action.ymlREADME.mdhttps://github.com/modelcontextprotocol/modelcontextprotocol/issues/1489

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.

4 participants