Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
fa69f90
Add reaction tools for issues and pull requests
timrogers Jun 19, 2026
a5511ca
Make reaction tools available in both granular and non-granular modes
timrogers Jun 19, 2026
774b75b
Update toolsnaps with aligned reaction tool descriptions
timrogers Jun 19, 2026
94c6f2c
Align reaction tool descriptions with codebase style
timrogers Jun 19, 2026
30da9da
Improve reaction tool responses and wording
timrogers Jun 19, 2026
009bb7b
Expose reactions through default comment tools
SamMorrowDrums Jun 23, 2026
e6276cf
Clarify PR review comment IDs for reactions
SamMorrowDrums Jun 23, 2026
7c53cde
Support issue comment reactions in add_issue_comment
SamMorrowDrums Jun 23, 2026
9908fbf
Merge branch 'main' into timrogers/planning-reaction-tools
SamMorrowDrums Jun 23, 2026
2c9410b
Harden combined comment reaction tools
SamMorrowDrums Jun 23, 2026
d218ebe
Group reaction tools with granular registrations
SamMorrowDrums Jun 23, 2026
7fff6f2
Align granular reaction tool constructors
SamMorrowDrums Jun 23, 2026
9855c06
Require issue number for comment reactions
SamMorrowDrums Jun 24, 2026
b0d11b0
Address issue comment feedback
SamMorrowDrums Jun 26, 2026
ca55793
Merge branch 'main' into timrogers/planning-reaction-tools
SamMorrowDrums Jun 26, 2026
e522c77
Validate issue comment reaction target
SamMorrowDrums Jun 26, 2026
ea14878
Validate positive comment IDs
SamMorrowDrums Jun 26, 2026
95737a9
Merge remote-tracking branch 'origin/main' into pr/2732/timrogers/pla…
SamMorrowDrums Jun 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve reaction tool responses and wording
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>
  • Loading branch information
timrogers and Copilot committed Jun 19, 2026
commit 30da9da36f5dfde159d4937523f2ca1456ac580a
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -846,14 +846,14 @@ The following sets of tools are available:
- `owner`: Repository owner (string, required)
- `repo`: Repository name (string, required)

- **add_issue_comment_reaction** - Add Issue Comment Reaction
- **add_issue_comment_reaction** - Add Reaction to Issue or Pull Request Comment
- **Required OAuth Scopes**: `repo`
- `comment_id`: The issue comment ID (number, required)
- `content`: The emoji reaction type (string, required)
- `owner`: Repository owner (username or organization) (string, required)
- `repo`: Repository name (string, required)

- **add_issue_reaction** - Add Issue Reaction
- **add_issue_reaction** - Add Reaction to Issue or Pull Request
- **Required OAuth Scopes**: `repo`
- `content`: The emoji reaction type (string, required)
- `issue_number`: The issue number (number, required)
Expand Down
4 changes: 2 additions & 2 deletions pkg/github/__toolsnaps__/add_issue_comment_reaction.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"annotations": {
"destructiveHint": false,
"openWorldHint": true,
"title": "Add Issue Comment Reaction"
"title": "Add Reaction to Issue or Pull Request Comment"
},
"description": "Add a reaction to an issue comment.",
"description": "Add a reaction to an issue or pull request comment.",
"inputSchema": {
"properties": {
"comment_id": {
Expand Down
4 changes: 2 additions & 2 deletions pkg/github/__toolsnaps__/add_issue_reaction.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"annotations": {
"destructiveHint": false,
"openWorldHint": true,
"title": "Add Issue Reaction"
"title": "Add Reaction to Issue or Pull Request"
},
"description": "Add a reaction to an issue.",
"description": "Add a reaction to an issue or pull request.",
"inputSchema": {
"properties": {
"content": {
Expand Down
16 changes: 16 additions & 0 deletions pkg/github/granular_tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package github

import (
"context"
"encoding/json"
"net/http"
"strings"
"testing"
Expand Down Expand Up @@ -2091,6 +2092,11 @@ func TestAddIssueReaction(t *testing.T) {
assert.True(t, result.IsError)
} else {
assert.False(t, result.IsError)
textContent := getTextResult(t, result)
var response MinimalResponse
require.NoError(t, json.Unmarshal([]byte(textContent.Text), &response))
assert.Equal(t, "12345", response.ID)
assert.Equal(t, "https://api.github.com/repos/owner/repo/issues/42/reactions/12345", response.URL)
}
})
}
Expand Down Expand Up @@ -2146,6 +2152,11 @@ func TestAddIssueCommentReaction(t *testing.T) {
assert.True(t, result.IsError)
} else {
assert.False(t, result.IsError)
textContent := getTextResult(t, result)
var response MinimalResponse
require.NoError(t, json.Unmarshal([]byte(textContent.Text), &response))
assert.Equal(t, "67890", response.ID)
assert.Equal(t, "https://api.github.com/repos/owner/repo/issues/comments/999/reactions/67890", response.URL)
}
})
}
Expand Down Expand Up @@ -2201,6 +2212,11 @@ func TestAddPullRequestReviewCommentReaction(t *testing.T) {
assert.True(t, result.IsError)
} else {
assert.False(t, result.IsError)
textContent := getTextResult(t, result)
var response MinimalResponse
require.NoError(t, json.Unmarshal([]byte(textContent.Text), &response))
assert.Equal(t, "54321", response.ID)
assert.Equal(t, "https://api.github.com/repos/owner/repo/pulls/comments/888/reactions/54321", response.URL)
}
})
}
Expand Down
18 changes: 10 additions & 8 deletions pkg/github/issues_granular.go
Original file line number Diff line number Diff line change
Expand Up @@ -1199,15 +1199,15 @@ func GranularSetIssueFields(t translations.TranslationHelperFunc) inventory.Serv
return st
}

// AddIssueReaction adds a reaction to an issue.
// AddIssueReaction adds a reaction to an issue or pull request.
func AddIssueReaction(t translations.TranslationHelperFunc) inventory.ServerTool {
st := NewTool(
ToolsetMetadataIssues,
mcp.Tool{
Name: "add_issue_reaction",
Description: t("TOOL_ADD_ISSUE_REACTION_DESCRIPTION", "Add a reaction to an issue."),
Description: t("TOOL_ADD_ISSUE_REACTION_DESCRIPTION", "Add a reaction to an issue or pull request."),
Annotations: &mcp.ToolAnnotations{
Comment thread
Copilot marked this conversation as resolved.
Title: t("TOOL_ADD_ISSUE_REACTION_USER_TITLE", "Add Issue Reaction"),
Title: t("TOOL_ADD_ISSUE_REACTION_USER_TITLE", "Add Reaction to Issue or Pull Request"),
ReadOnlyHint: false,
DestructiveHint: jsonschema.Ptr(false),
OpenWorldHint: jsonschema.Ptr(true),
Expand Down Expand Up @@ -1268,7 +1268,8 @@ func AddIssueReaction(t translations.TranslationHelperFunc) inventory.ServerTool
defer func() { _ = resp.Body.Close() }()

r, err := json.Marshal(MinimalResponse{
ID: fmt.Sprintf("%d", reaction.GetID()),
ID: fmt.Sprintf("%d", reaction.GetID()),
URL: fmt.Sprintf("%srepos/%s/%s/issues/%d/reactions/%d", client.BaseURL(), owner, repo, issueNumber, reaction.GetID()),
})
Comment on lines +1270 to +1273
if err != nil {
return utils.NewToolResultErrorFromErr("failed to marshal response", err), nil, nil
Expand All @@ -1279,15 +1280,15 @@ func AddIssueReaction(t translations.TranslationHelperFunc) inventory.ServerTool
return st
Comment thread
SamMorrowDrums marked this conversation as resolved.
Comment thread
SamMorrowDrums marked this conversation as resolved.
}

// AddIssueCommentReaction adds a reaction to an issue comment.
// AddIssueCommentReaction adds a reaction to an issue or pull request comment.
func AddIssueCommentReaction(t translations.TranslationHelperFunc) inventory.ServerTool {
st := NewTool(
ToolsetMetadataIssues,
mcp.Tool{
Name: "add_issue_comment_reaction",
Description: t("TOOL_ADD_ISSUE_COMMENT_REACTION_DESCRIPTION", "Add a reaction to an issue comment."),
Description: t("TOOL_ADD_ISSUE_COMMENT_REACTION_DESCRIPTION", "Add a reaction to an issue or pull request comment."),
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_ADD_ISSUE_COMMENT_REACTION_USER_TITLE", "Add Issue Comment Reaction"),
Title: t("TOOL_ADD_ISSUE_COMMENT_REACTION_USER_TITLE", "Add Reaction to Issue or Pull Request Comment"),
ReadOnlyHint: false,
DestructiveHint: jsonschema.Ptr(false),
OpenWorldHint: jsonschema.Ptr(true),
Expand Down Expand Up @@ -1348,7 +1349,8 @@ func AddIssueCommentReaction(t translations.TranslationHelperFunc) inventory.Ser
defer func() { _ = resp.Body.Close() }()

r, err := json.Marshal(MinimalResponse{
ID: fmt.Sprintf("%d", reaction.GetID()),
ID: fmt.Sprintf("%d", reaction.GetID()),
URL: fmt.Sprintf("%srepos/%s/%s/issues/comments/%d/reactions/%d", client.BaseURL(), owner, repo, commentID, reaction.GetID()),
})
Comment on lines +1352 to +1355
if err != nil {
return utils.NewToolResultErrorFromErr("failed to marshal response", err), nil, nil
Expand Down
3 changes: 2 additions & 1 deletion pkg/github/pullrequests_granular.go
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,8 @@ func AddPullRequestReviewCommentReaction(t translations.TranslationHelperFunc) i
defer func() { _ = resp.Body.Close() }()

r, err := json.Marshal(MinimalResponse{
ID: fmt.Sprintf("%d", reaction.GetID()),
ID: fmt.Sprintf("%d", reaction.GetID()),
URL: fmt.Sprintf("%srepos/%s/%s/pulls/comments/%d/reactions/%d", client.BaseURL(), owner, repo, commentID, reaction.GetID()),
})
Comment on lines +829 to +832
if err != nil {
return utils.NewToolResultErrorFromErr("failed to marshal response", err), nil, nil
Expand Down
Loading