Skip to content

Commit 37f74d2

Browse files
committed
update get_pull_request_comments to get_pull_request_review_comments to signify difference
1 parent bbb411f commit 37f74d2

File tree

5 files changed

+44
-14
lines changed

5 files changed

+44
-14
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,11 +701,6 @@ The following sets of tools are available (all are on by default):
701701
- `pullNumber`: Pull request number (number, required)
702702
- `repo`: Repository name (string, required)
703703

704-
- **get_pull_request_comments** - Get pull request comments
705-
- `owner`: Repository owner (string, required)
706-
- `pullNumber`: Pull request number (number, required)
707-
- `repo`: Repository name (string, required)
708-
709704
- **get_pull_request_diff** - Get pull request diff
710705
- `owner`: Repository owner (string, required)
711706
- `pullNumber`: Pull request number (number, required)
@@ -718,6 +713,11 @@ The following sets of tools are available (all are on by default):
718713
- `pullNumber`: Pull request number (number, required)
719714
- `repo`: Repository name (string, required)
720715

716+
- **get_pull_request_review_comments** - Get pull request comments
717+
- `owner`: Repository owner (string, required)
718+
- `pullNumber`: Pull request number (number, required)
719+
- `repo`: Repository name (string, required)
720+
721721
- **get_pull_request_reviews** - Get pull request reviews
722722
- `owner`: Repository owner (string, required)
723723
- `pullNumber`: Pull request number (number, required)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"annotations": {
3+
"title": "Get pull request comments",
4+
"readOnlyHint": true
5+
},
6+
"description": "Get pull request review comments. They are comments made on a portion of the unified diff during a pull request review. These are different from commit comments and issue comments in a pull request.",
7+
"inputSchema": {
8+
"properties": {
9+
"owner": {
10+
"description": "Repository owner",
11+
"type": "string"
12+
},
13+
"pullNumber": {
14+
"description": "Pull request number",
15+
"type": "number"
16+
},
17+
"repo": {
18+
"description": "Repository name",
19+
"type": "string"
20+
}
21+
},
22+
"required": [
23+
"owner",
24+
"repo",
25+
"pullNumber"
26+
],
27+
"type": "object"
28+
},
29+
"name": "get_pull_request_review_comments"
30+
}

pkg/github/pullrequests.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -975,12 +975,12 @@ func UpdatePullRequestBranch(getClient GetClientFn, t translations.TranslationHe
975975
}
976976
}
977977

978-
// GetPullRequestComments creates a tool to get the review comments on a pull request.
979-
func GetPullRequestComments(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
980-
return mcp.NewTool("get_pull_request_comments",
981-
mcp.WithDescription(t("TOOL_GET_PULL_REQUEST_COMMENTS_DESCRIPTION", "Get comments for a specific pull request.")),
978+
// GetPullRequestReviewComments creates a tool to get the review comments on a pull request.
979+
func GetPullRequestReviewComments(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
980+
return mcp.NewTool("get_pull_request_review_comments",
981+
mcp.WithDescription(t("TOOL_GET_PULL_REQUEST_REVIEW_COMMENTS_DESCRIPTION", "Get pull request review comments. They are comments made on a portion of the unified diff during a pull request review. These are different from commit comments and issue comments in a pull request.")),
982982
mcp.WithToolAnnotation(mcp.ToolAnnotation{
983-
Title: t("TOOL_GET_PULL_REQUEST_COMMENTS_USER_TITLE", "Get pull request comments"),
983+
Title: t("TOOL_GET_PULL_REQUEST_REVIEW_COMMENTS_USER_TITLE", "Get pull request comments"),
984984
ReadOnlyHint: ToBoolPtr(true),
985985
}),
986986
mcp.WithString("owner",

pkg/github/pullrequests_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,10 +1555,10 @@ func Test_UpdatePullRequestBranch(t *testing.T) {
15551555
func Test_GetPullRequestComments(t *testing.T) {
15561556
// Verify tool definition once
15571557
mockClient := github.NewClient(nil)
1558-
tool, _ := GetPullRequestComments(stubGetClientFn(mockClient), translations.NullTranslationHelper)
1558+
tool, _ := GetPullRequestReviewComments(stubGetClientFn(mockClient), translations.NullTranslationHelper)
15591559
require.NoError(t, toolsnaps.Test(tool.Name, tool))
15601560

1561-
assert.Equal(t, "get_pull_request_comments", tool.Name)
1561+
assert.Equal(t, "get_pull_request_review_comments", tool.Name)
15621562
assert.NotEmpty(t, tool.Description)
15631563
assert.Contains(t, tool.InputSchema.Properties, "owner")
15641564
assert.Contains(t, tool.InputSchema.Properties, "repo")
@@ -1644,7 +1644,7 @@ func Test_GetPullRequestComments(t *testing.T) {
16441644
t.Run(tc.name, func(t *testing.T) {
16451645
// Setup client with mock
16461646
client := github.NewClient(tc.mockedClient)
1647-
_, handler := GetPullRequestComments(stubGetClientFn(client), translations.NullTranslationHelper)
1647+
_, handler := GetPullRequestReviewComments(stubGetClientFn(client), translations.NullTranslationHelper)
16481648

16491649
// Create call request
16501650
request := createMCPRequest(tc.requestArgs)

pkg/github/tools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
8686
toolsets.NewServerTool(GetPullRequestFiles(getClient, t)),
8787
toolsets.NewServerTool(SearchPullRequests(getClient, t)),
8888
toolsets.NewServerTool(GetPullRequestStatus(getClient, t)),
89-
toolsets.NewServerTool(GetPullRequestComments(getClient, t)),
89+
toolsets.NewServerTool(GetPullRequestReviewComments(getClient, t)),
9090
toolsets.NewServerTool(GetPullRequestReviews(getClient, t)),
9191
toolsets.NewServerTool(GetPullRequestDiff(getClient, t)),
9292
).

0 commit comments

Comments
 (0)