Skip to content

Commit 42d7449

Browse files
committed
shorten tool name
1 parent be91795 commit 42d7449

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
722722

723723
<summary>Pull Requests</summary>
724724

725-
- **add_pull_request_review_comment_to_pending_review** - Add comment to the requester's latest pending pull request review
725+
- **add_comment_to_pending_review** - Add comment to the requester's latest pending pull request review
726726
- `body`: The text of the review comment (string, required)
727727
- `line`: The line of the blob in the pull request diff that the comment applies to. For multi-line comments, the last line of the range (number, optional)
728728
- `owner`: Repository owner (string, required)

e2e/e2e_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ func TestPullRequestReviewCommentSubmit(t *testing.T) {
13381338

13391339
// Add a file review comment
13401340
addFileReviewCommentRequest := mcp.CallToolRequest{}
1341-
addFileReviewCommentRequest.Params.Name = "add_pull_request_review_comment_to_pending_review"
1341+
addFileReviewCommentRequest.Params.Name = "add_comment_to_pending_review"
13421342
addFileReviewCommentRequest.Params.Arguments = map[string]any{
13431343
"owner": currentOwner,
13441344
"repo": repoName,
@@ -1350,12 +1350,12 @@ func TestPullRequestReviewCommentSubmit(t *testing.T) {
13501350

13511351
t.Logf("Adding file review comment to pull request in %s/%s...", currentOwner, repoName)
13521352
resp, err = mcpClient.CallTool(ctx, addFileReviewCommentRequest)
1353-
require.NoError(t, err, "expected to call 'add_pull_request_review_comment_to_pending_review' tool successfully")
1353+
require.NoError(t, err, "expected to call 'add_comment_to_pending_review' tool successfully")
13541354
require.False(t, resp.IsError, fmt.Sprintf("expected result not to be an error: %+v", resp))
13551355

13561356
// Add a single line review comment
13571357
addSingleLineReviewCommentRequest := mcp.CallToolRequest{}
1358-
addSingleLineReviewCommentRequest.Params.Name = "add_pull_request_review_comment_to_pending_review"
1358+
addSingleLineReviewCommentRequest.Params.Name = "add_comment_to_pending_review"
13591359
addSingleLineReviewCommentRequest.Params.Arguments = map[string]any{
13601360
"owner": currentOwner,
13611361
"repo": repoName,
@@ -1370,12 +1370,12 @@ func TestPullRequestReviewCommentSubmit(t *testing.T) {
13701370

13711371
t.Logf("Adding single line review comment to pull request in %s/%s...", currentOwner, repoName)
13721372
resp, err = mcpClient.CallTool(ctx, addSingleLineReviewCommentRequest)
1373-
require.NoError(t, err, "expected to call 'add_pull_request_review_comment_to_pending_review' tool successfully")
1373+
require.NoError(t, err, "expected to call 'add_comment_to_pending_review' tool successfully")
13741374
require.False(t, resp.IsError, fmt.Sprintf("expected result not to be an error: %+v", resp))
13751375

13761376
// Add a multiline review comment
13771377
addMultilineReviewCommentRequest := mcp.CallToolRequest{}
1378-
addMultilineReviewCommentRequest.Params.Name = "add_pull_request_review_comment_to_pending_review"
1378+
addMultilineReviewCommentRequest.Params.Name = "add_comment_to_pending_review"
13791379
addMultilineReviewCommentRequest.Params.Arguments = map[string]any{
13801380
"owner": currentOwner,
13811381
"repo": repoName,
@@ -1392,7 +1392,7 @@ func TestPullRequestReviewCommentSubmit(t *testing.T) {
13921392

13931393
t.Logf("Adding multi line review comment to pull request in %s/%s...", currentOwner, repoName)
13941394
resp, err = mcpClient.CallTool(ctx, addMultilineReviewCommentRequest)
1395-
require.NoError(t, err, "expected to call 'add_pull_request_review_comment_to_pending_review' tool successfully")
1395+
require.NoError(t, err, "expected to call 'add_comment_to_pending_review' tool successfully")
13961396
require.False(t, resp.IsError, fmt.Sprintf("expected result not to be an error: %+v", resp))
13971397

13981398
// Submit the review

pkg/github/__toolsnaps__/add_pull_request_review_comment_to_pending_review.snap renamed to pkg/github/__toolsnaps__/add_comment_to_pending_review.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title": "Add comment to the requester's latest pending pull request review",
44
"readOnlyHint": false
55
},
6-
"description": "Add a comment to the requester's latest pending pull request review, a pending review needs to already exist to call this (check with the user if not sure).",
6+
"description": "Add a review comment to the requester's latest pending pull request review, a pending review needs to already exist to call this (check with the user if not sure).",
77
"inputSchema": {
88
"properties": {
99
"body": {
@@ -69,5 +69,5 @@
6969
],
7070
"type": "object"
7171
},
72-
"name": "add_pull_request_review_comment_to_pending_review"
72+
"name": "add_comment_to_pending_review"
7373
}

pkg/github/pullrequests.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,10 +1153,10 @@ func CreatePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.
11531153

11541154
// AddPullRequestReviewCommentToPendingReview creates a tool to add a comment to a pull request review.
11551155
func AddPullRequestReviewCommentToPendingReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
1156-
return mcp.NewTool("add_pull_request_review_comment_to_pending_review",
1157-
mcp.WithDescription(t("TOOL_ADD_PULL_REQUEST_REVIEW_COMMENT_TO_PENDING_REVIEW_DESCRIPTION", "Add a comment to the requester's latest pending pull request review, a pending review needs to already exist to call this (check with the user if not sure).")),
1156+
return mcp.NewTool("add_comment_to_pending_review",
1157+
mcp.WithDescription(t("TOOL_ADD_COMMENT_TO_PENDING_REVIEW_DESCRIPTION", "Add a review comment to the requester's latest pending pull request review, a pending review needs to already exist to call this (check with the user if not sure).")),
11581158
mcp.WithToolAnnotation(mcp.ToolAnnotation{
1159-
Title: t("TOOL_ADD_PULL_REQUEST_REVIEW_COMMENT_TO_PENDING_REVIEW_USER_TITLE", "Add comment to the requester's latest pending pull request review"),
1159+
Title: t("TOOL_ADD_COMMENT_TO_PENDING_REVIEW_USER_TITLE", "Add comment to the requester's latest pending pull request review"),
11601160
ReadOnlyHint: ToBoolPtr(false),
11611161
}),
11621162
// Ideally, for performance sake this would just accept the pullRequestReviewID. However, we would need to

pkg/github/pullrequests_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,7 @@ func TestAddPullRequestReviewCommentToPendingReview(t *testing.T) {
21402140
tool, _ := AddPullRequestReviewCommentToPendingReview(stubGetGQLClientFn(mockClient), translations.NullTranslationHelper)
21412141
require.NoError(t, toolsnaps.Test(tool.Name, tool))
21422142

2143-
assert.Equal(t, "add_pull_request_review_comment_to_pending_review", tool.Name)
2143+
assert.Equal(t, "add_comment_to_pending_review", tool.Name)
21442144
assert.NotEmpty(t, tool.Description)
21452145
assert.Contains(t, tool.InputSchema.Properties, "owner")
21462146
assert.Contains(t, tool.InputSchema.Properties, "repo")

0 commit comments

Comments
 (0)