@@ -7,13 +7,14 @@ import (
7
7
"io"
8
8
"net/http"
9
9
10
+ "github.com/github/github-mcp-server/pkg/translations"
10
11
"github.com/google/go-github/v69/github"
11
12
"github.com/mark3labs/mcp-go/mcp"
12
13
"github.com/mark3labs/mcp-go/server"
13
14
)
14
15
15
16
// getPullRequest creates a tool to get details of a specific pull request.
16
- func getPullRequest (client * github.Client , t func ( string , string ) string ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
17
+ func getPullRequest (client * github.Client , t translations. TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
17
18
return mcp .NewTool ("get_pull_request" ,
18
19
mcp .WithDescription (t ("TOOL_GET_PULL_REQUEST_DESCRIPTION" , "Get details of a specific pull request" )),
19
20
mcp .WithString ("owner" ,
@@ -58,7 +59,7 @@ func getPullRequest(client *github.Client, t func(string, string) string) (tool
58
59
}
59
60
60
61
// listPullRequests creates a tool to list and filter repository pull requests.
61
- func listPullRequests (client * github.Client , t func ( string , string ) string ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
62
+ func listPullRequests (client * github.Client , t translations. TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
62
63
return mcp .NewTool ("list_pull_requests" ,
63
64
mcp .WithDescription (t ("TOOL_LIST_PULL_REQUESTS_DESCRIPTION" , "List and filter repository pull requests" )),
64
65
mcp .WithString ("owner" ,
@@ -159,7 +160,7 @@ func listPullRequests(client *github.Client, t func(string, string) string) (too
159
160
}
160
161
161
162
// mergePullRequest creates a tool to merge a pull request.
162
- func mergePullRequest (client * github.Client , t func ( string , string ) string ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
163
+ func mergePullRequest (client * github.Client , t translations. TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
163
164
return mcp .NewTool ("merge_pull_request" ,
164
165
mcp .WithDescription (t ("TOOL_MERGE_PULL_REQUEST_DESCRIPTION" , "Merge a pull request" )),
165
166
mcp .WithString ("owner" ,
@@ -230,7 +231,7 @@ func mergePullRequest(client *github.Client, t func(string, string) string) (too
230
231
}
231
232
232
233
// getPullRequestFiles creates a tool to get the list of files changed in a pull request.
233
- func getPullRequestFiles (client * github.Client , t func ( string , string ) string ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
234
+ func getPullRequestFiles (client * github.Client , t translations. TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
234
235
return mcp .NewTool ("get_pull_request_files" ,
235
236
mcp .WithDescription (t ("TOOL_GET_PULL_REQUEST_FILES_DESCRIPTION" , "Get the list of files changed in a pull request" )),
236
237
mcp .WithString ("owner" ,
@@ -276,7 +277,7 @@ func getPullRequestFiles(client *github.Client, t func(string, string) string) (
276
277
}
277
278
278
279
// getPullRequestStatus creates a tool to get the combined status of all status checks for a pull request.
279
- func getPullRequestStatus (client * github.Client , t func ( string , string ) string ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
280
+ func getPullRequestStatus (client * github.Client , t translations. TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
280
281
return mcp .NewTool ("get_pull_request_status" ,
281
282
mcp .WithDescription (t ("TOOL_GET_PULL_REQUEST_STATUS_DESCRIPTION" , "Get the combined status of all status checks for a pull request" )),
282
283
mcp .WithString ("owner" ,
@@ -337,7 +338,7 @@ func getPullRequestStatus(client *github.Client, t func(string, string) string)
337
338
}
338
339
339
340
// updatePullRequestBranch creates a tool to update a pull request branch with the latest changes from the base branch.
340
- func updatePullRequestBranch (client * github.Client , t func ( string , string ) string ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
341
+ func updatePullRequestBranch (client * github.Client , t translations. TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
341
342
return mcp .NewTool ("update_pull_request_branch" ,
342
343
mcp .WithDescription (t ("TOOL_UPDATE_PULL_REQUEST_BRANCH_DESCRIPTION" , "Update a pull request branch with the latest changes from the base branch" )),
343
344
mcp .WithString ("owner" ,
@@ -399,7 +400,7 @@ func updatePullRequestBranch(client *github.Client, t func(string, string) strin
399
400
}
400
401
401
402
// getPullRequestComments creates a tool to get the review comments on a pull request.
402
- func getPullRequestComments (client * github.Client , t func ( string , string ) string ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
403
+ func getPullRequestComments (client * github.Client , t translations. TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
403
404
return mcp .NewTool ("get_pull_request_comments" ,
404
405
mcp .WithDescription (t ("TOOL_GET_PULL_REQUEST_COMMENTS_DESCRIPTION" , "Get the review comments on a pull request" )),
405
406
mcp .WithString ("owner" ,
@@ -450,7 +451,7 @@ func getPullRequestComments(client *github.Client, t func(string, string) string
450
451
}
451
452
452
453
// getPullRequestReviews creates a tool to get the reviews on a pull request.
453
- func getPullRequestReviews (client * github.Client , t func ( string , string ) string ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
454
+ func getPullRequestReviews (client * github.Client , t translations. TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
454
455
return mcp .NewTool ("get_pull_request_reviews" ,
455
456
mcp .WithDescription (t ("TOOL_GET_PULL_REQUEST_REVIEWS_DESCRIPTION" , "Get the reviews on a pull request" )),
456
457
mcp .WithString ("owner" ,
0 commit comments