@@ -7,13 +7,14 @@ import (
77 "io"
88 "net/http"
99
10+ "github.com/github/github-mcp-server/pkg/translations"
1011 "github.com/google/go-github/v69/github"
1112 "github.com/mark3labs/mcp-go/mcp"
1213 "github.com/mark3labs/mcp-go/server"
1314)
1415
1516// 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 ) {
1718 return mcp .NewTool ("get_pull_request" ,
1819 mcp .WithDescription (t ("TOOL_GET_PULL_REQUEST_DESCRIPTION" , "Get details of a specific pull request" )),
1920 mcp .WithString ("owner" ,
@@ -58,7 +59,7 @@ func getPullRequest(client *github.Client, t func(string, string) string) (tool
5859}
5960
6061// 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 ) {
6263 return mcp .NewTool ("list_pull_requests" ,
6364 mcp .WithDescription (t ("TOOL_LIST_PULL_REQUESTS_DESCRIPTION" , "List and filter repository pull requests" )),
6465 mcp .WithString ("owner" ,
@@ -159,7 +160,7 @@ func listPullRequests(client *github.Client, t func(string, string) string) (too
159160}
160161
161162// 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 ) {
163164 return mcp .NewTool ("merge_pull_request" ,
164165 mcp .WithDescription (t ("TOOL_MERGE_PULL_REQUEST_DESCRIPTION" , "Merge a pull request" )),
165166 mcp .WithString ("owner" ,
@@ -230,7 +231,7 @@ func mergePullRequest(client *github.Client, t func(string, string) string) (too
230231}
231232
232233// 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 ) {
234235 return mcp .NewTool ("get_pull_request_files" ,
235236 mcp .WithDescription (t ("TOOL_GET_PULL_REQUEST_FILES_DESCRIPTION" , "Get the list of files changed in a pull request" )),
236237 mcp .WithString ("owner" ,
@@ -276,7 +277,7 @@ func getPullRequestFiles(client *github.Client, t func(string, string) string) (
276277}
277278
278279// 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 ) {
280281 return mcp .NewTool ("get_pull_request_status" ,
281282 mcp .WithDescription (t ("TOOL_GET_PULL_REQUEST_STATUS_DESCRIPTION" , "Get the combined status of all status checks for a pull request" )),
282283 mcp .WithString ("owner" ,
@@ -337,7 +338,7 @@ func getPullRequestStatus(client *github.Client, t func(string, string) string)
337338}
338339
339340// 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 ) {
341342 return mcp .NewTool ("update_pull_request_branch" ,
342343 mcp .WithDescription (t ("TOOL_UPDATE_PULL_REQUEST_BRANCH_DESCRIPTION" , "Update a pull request branch with the latest changes from the base branch" )),
343344 mcp .WithString ("owner" ,
@@ -399,7 +400,7 @@ func updatePullRequestBranch(client *github.Client, t func(string, string) strin
399400}
400401
401402// 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 ) {
403404 return mcp .NewTool ("get_pull_request_comments" ,
404405 mcp .WithDescription (t ("TOOL_GET_PULL_REQUEST_COMMENTS_DESCRIPTION" , "Get the review comments on a pull request" )),
405406 mcp .WithString ("owner" ,
@@ -450,7 +451,7 @@ func getPullRequestComments(client *github.Client, t func(string, string) string
450451}
451452
452453// 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 ) {
454455 return mcp .NewTool ("get_pull_request_reviews" ,
455456 mcp .WithDescription (t ("TOOL_GET_PULL_REQUEST_REVIEWS_DESCRIPTION" , "Get the reviews on a pull request" )),
456457 mcp .WithString ("owner" ,
0 commit comments