@@ -14,8 +14,8 @@ import (
1414 "github.com/mark3labs/mcp-go/server"
1515)
1616
17- // getIssue creates a tool to get details of a specific issue in a GitHub repository.
18- func getIssue (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
17+ // GetIssue creates a tool to get details of a specific issue in a GitHub repository.
18+ func GetIssue (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
1919 return mcp .NewTool ("get_issue" ,
2020 mcp .WithDescription (t ("TOOL_GET_ISSUE_DESCRIPTION" , "Get details of a specific issue in a GitHub repository" )),
2121 mcp .WithString ("owner" ,
@@ -40,7 +40,7 @@ func getIssue(client *github.Client, t translations.TranslationHelperFunc) (tool
4040 if err != nil {
4141 return mcp .NewToolResultError (err .Error ()), nil
4242 }
43- issueNumber , err := requiredInt (request , "issue_number" )
43+ issueNumber , err := RequiredInt (request , "issue_number" )
4444 if err != nil {
4545 return mcp .NewToolResultError (err .Error ()), nil
4646 }
@@ -68,8 +68,8 @@ func getIssue(client *github.Client, t translations.TranslationHelperFunc) (tool
6868 }
6969}
7070
71- // addIssueComment creates a tool to add a comment to an issue.
72- func addIssueComment (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
71+ // AddIssueComment creates a tool to add a comment to an issue.
72+ func AddIssueComment (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
7373 return mcp .NewTool ("add_issue_comment" ,
7474 mcp .WithDescription (t ("TOOL_ADD_ISSUE_COMMENT_DESCRIPTION" , "Add a comment to an existing issue" )),
7575 mcp .WithString ("owner" ,
@@ -98,7 +98,7 @@ func addIssueComment(client *github.Client, t translations.TranslationHelperFunc
9898 if err != nil {
9999 return mcp .NewToolResultError (err .Error ()), nil
100100 }
101- issueNumber , err := requiredInt (request , "issue_number" )
101+ issueNumber , err := RequiredInt (request , "issue_number" )
102102 if err != nil {
103103 return mcp .NewToolResultError (err .Error ()), nil
104104 }
@@ -134,8 +134,8 @@ func addIssueComment(client *github.Client, t translations.TranslationHelperFunc
134134 }
135135}
136136
137- // searchIssues creates a tool to search for issues and pull requests.
138- func searchIssues (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
137+ // SearchIssues creates a tool to search for issues and pull requests.
138+ func SearchIssues (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
139139 return mcp .NewTool ("search_issues" ,
140140 mcp .WithDescription (t ("TOOL_SEARCH_ISSUES_DESCRIPTION" , "Search for issues and pull requests across GitHub repositories" )),
141141 mcp .WithString ("q" ,
@@ -162,22 +162,22 @@ func searchIssues(client *github.Client, t translations.TranslationHelperFunc) (
162162 mcp .Description ("Sort order ('asc' or 'desc')" ),
163163 mcp .Enum ("asc" , "desc" ),
164164 ),
165- withPagination (),
165+ WithPagination (),
166166 ),
167167 func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
168168 query , err := requiredParam [string ](request , "q" )
169169 if err != nil {
170170 return mcp .NewToolResultError (err .Error ()), nil
171171 }
172- sort , err := optionalParam [string ](request , "sort" )
172+ sort , err := OptionalParam [string ](request , "sort" )
173173 if err != nil {
174174 return mcp .NewToolResultError (err .Error ()), nil
175175 }
176- order , err := optionalParam [string ](request , "order" )
176+ order , err := OptionalParam [string ](request , "order" )
177177 if err != nil {
178178 return mcp .NewToolResultError (err .Error ()), nil
179179 }
180- pagination , err := optionalPaginationParams (request )
180+ pagination , err := OptionalPaginationParams (request )
181181 if err != nil {
182182 return mcp .NewToolResultError (err .Error ()), nil
183183 }
@@ -214,8 +214,8 @@ func searchIssues(client *github.Client, t translations.TranslationHelperFunc) (
214214 }
215215}
216216
217- // createIssue creates a tool to create a new issue in a GitHub repository.
218- func createIssue (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
217+ // CreateIssue creates a tool to create a new issue in a GitHub repository.
218+ func CreateIssue (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
219219 return mcp .NewTool ("create_issue" ,
220220 mcp .WithDescription (t ("TOOL_CREATE_ISSUE_DESCRIPTION" , "Create a new issue in a GitHub repository" )),
221221 mcp .WithString ("owner" ,
@@ -268,25 +268,25 @@ func createIssue(client *github.Client, t translations.TranslationHelperFunc) (t
268268 }
269269
270270 // Optional parameters
271- body , err := optionalParam [string ](request , "body" )
271+ body , err := OptionalParam [string ](request , "body" )
272272 if err != nil {
273273 return mcp .NewToolResultError (err .Error ()), nil
274274 }
275275
276276 // Get assignees
277- assignees , err := optionalStringArrayParam (request , "assignees" )
277+ assignees , err := OptionalStringArrayParam (request , "assignees" )
278278 if err != nil {
279279 return mcp .NewToolResultError (err .Error ()), nil
280280 }
281281
282282 // Get labels
283- labels , err := optionalStringArrayParam (request , "labels" )
283+ labels , err := OptionalStringArrayParam (request , "labels" )
284284 if err != nil {
285285 return mcp .NewToolResultError (err .Error ()), nil
286286 }
287287
288288 // Get optional milestone
289- milestone , err := optionalIntParam (request , "milestone" )
289+ milestone , err := OptionalIntParam (request , "milestone" )
290290 if err != nil {
291291 return mcp .NewToolResultError (err .Error ()), nil
292292 }
@@ -328,8 +328,8 @@ func createIssue(client *github.Client, t translations.TranslationHelperFunc) (t
328328 }
329329}
330330
331- // listIssues creates a tool to list and filter repository issues
332- func listIssues (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
331+ // ListIssues creates a tool to list and filter repository issues
332+ func ListIssues (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
333333 return mcp .NewTool ("list_issues" ,
334334 mcp .WithDescription (t ("TOOL_LIST_ISSUES_DESCRIPTION" , "List issues in a GitHub repository with filtering options" )),
335335 mcp .WithString ("owner" ,
@@ -363,7 +363,7 @@ func listIssues(client *github.Client, t translations.TranslationHelperFunc) (to
363363 mcp .WithString ("since" ,
364364 mcp .Description ("Filter by date (ISO 8601 timestamp)" ),
365365 ),
366- withPagination (),
366+ WithPagination (),
367367 ),
368368 func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
369369 owner , err := requiredParam [string ](request , "owner" )
@@ -378,28 +378,28 @@ func listIssues(client *github.Client, t translations.TranslationHelperFunc) (to
378378 opts := & github.IssueListByRepoOptions {}
379379
380380 // Set optional parameters if provided
381- opts .State , err = optionalParam [string ](request , "state" )
381+ opts .State , err = OptionalParam [string ](request , "state" )
382382 if err != nil {
383383 return mcp .NewToolResultError (err .Error ()), nil
384384 }
385385
386386 // Get labels
387- opts .Labels , err = optionalStringArrayParam (request , "labels" )
387+ opts .Labels , err = OptionalStringArrayParam (request , "labels" )
388388 if err != nil {
389389 return mcp .NewToolResultError (err .Error ()), nil
390390 }
391391
392- opts .Sort , err = optionalParam [string ](request , "sort" )
392+ opts .Sort , err = OptionalParam [string ](request , "sort" )
393393 if err != nil {
394394 return mcp .NewToolResultError (err .Error ()), nil
395395 }
396396
397- opts .Direction , err = optionalParam [string ](request , "direction" )
397+ opts .Direction , err = OptionalParam [string ](request , "direction" )
398398 if err != nil {
399399 return mcp .NewToolResultError (err .Error ()), nil
400400 }
401401
402- since , err := optionalParam [string ](request , "since" )
402+ since , err := OptionalParam [string ](request , "since" )
403403 if err != nil {
404404 return mcp .NewToolResultError (err .Error ()), nil
405405 }
@@ -442,8 +442,8 @@ func listIssues(client *github.Client, t translations.TranslationHelperFunc) (to
442442 }
443443}
444444
445- // updateIssue creates a tool to update an existing issue in a GitHub repository.
446- func updateIssue (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
445+ // UpdateIssue creates a tool to update an existing issue in a GitHub repository.
446+ func UpdateIssue (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
447447 return mcp .NewTool ("update_issue" ,
448448 mcp .WithDescription (t ("TOOL_UPDATE_ISSUE_DESCRIPTION" , "Update an existing issue in a GitHub repository" )),
449449 mcp .WithString ("owner" ,
@@ -497,7 +497,7 @@ func updateIssue(client *github.Client, t translations.TranslationHelperFunc) (t
497497 if err != nil {
498498 return mcp .NewToolResultError (err .Error ()), nil
499499 }
500- issueNumber , err := requiredInt (request , "issue_number" )
500+ issueNumber , err := RequiredInt (request , "issue_number" )
501501 if err != nil {
502502 return mcp .NewToolResultError (err .Error ()), nil
503503 }
@@ -506,23 +506,23 @@ func updateIssue(client *github.Client, t translations.TranslationHelperFunc) (t
506506 issueRequest := & github.IssueRequest {}
507507
508508 // Set optional parameters if provided
509- title , err := optionalParam [string ](request , "title" )
509+ title , err := OptionalParam [string ](request , "title" )
510510 if err != nil {
511511 return mcp .NewToolResultError (err .Error ()), nil
512512 }
513513 if title != "" {
514514 issueRequest .Title = github .Ptr (title )
515515 }
516516
517- body , err := optionalParam [string ](request , "body" )
517+ body , err := OptionalParam [string ](request , "body" )
518518 if err != nil {
519519 return mcp .NewToolResultError (err .Error ()), nil
520520 }
521521 if body != "" {
522522 issueRequest .Body = github .Ptr (body )
523523 }
524524
525- state , err := optionalParam [string ](request , "state" )
525+ state , err := OptionalParam [string ](request , "state" )
526526 if err != nil {
527527 return mcp .NewToolResultError (err .Error ()), nil
528528 }
@@ -531,7 +531,7 @@ func updateIssue(client *github.Client, t translations.TranslationHelperFunc) (t
531531 }
532532
533533 // Get labels
534- labels , err := optionalStringArrayParam (request , "labels" )
534+ labels , err := OptionalStringArrayParam (request , "labels" )
535535 if err != nil {
536536 return mcp .NewToolResultError (err .Error ()), nil
537537 }
@@ -540,15 +540,15 @@ func updateIssue(client *github.Client, t translations.TranslationHelperFunc) (t
540540 }
541541
542542 // Get assignees
543- assignees , err := optionalStringArrayParam (request , "assignees" )
543+ assignees , err := OptionalStringArrayParam (request , "assignees" )
544544 if err != nil {
545545 return mcp .NewToolResultError (err .Error ()), nil
546546 }
547547 if len (assignees ) > 0 {
548548 issueRequest .Assignees = & assignees
549549 }
550550
551- milestone , err := optionalIntParam (request , "milestone" )
551+ milestone , err := OptionalIntParam (request , "milestone" )
552552 if err != nil {
553553 return mcp .NewToolResultError (err .Error ()), nil
554554 }
@@ -580,8 +580,8 @@ func updateIssue(client *github.Client, t translations.TranslationHelperFunc) (t
580580 }
581581}
582582
583- // getIssueComments creates a tool to get comments for a GitHub issue.
584- func getIssueComments (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
583+ // GetIssueComments creates a tool to get comments for a GitHub issue.
584+ func GetIssueComments (client * github.Client , t translations.TranslationHelperFunc ) (tool mcp.Tool , handler server.ToolHandlerFunc ) {
585585 return mcp .NewTool ("get_issue_comments" ,
586586 mcp .WithDescription (t ("TOOL_GET_ISSUE_COMMENTS_DESCRIPTION" , "Get comments for a GitHub issue" )),
587587 mcp .WithString ("owner" ,
@@ -612,15 +612,15 @@ func getIssueComments(client *github.Client, t translations.TranslationHelperFun
612612 if err != nil {
613613 return mcp .NewToolResultError (err .Error ()), nil
614614 }
615- issueNumber , err := requiredInt (request , "issue_number" )
615+ issueNumber , err := RequiredInt (request , "issue_number" )
616616 if err != nil {
617617 return mcp .NewToolResultError (err .Error ()), nil
618618 }
619- page , err := optionalIntParamWithDefault (request , "page" , 1 )
619+ page , err := OptionalIntParamWithDefault (request , "page" , 1 )
620620 if err != nil {
621621 return mcp .NewToolResultError (err .Error ()), nil
622622 }
623- perPage , err := optionalIntParamWithDefault (request , "per_page" , 30 )
623+ perPage , err := OptionalIntParamWithDefault (request , "per_page" , 30 )
624624 if err != nil {
625625 return mcp .NewToolResultError (err .Error ()), nil
626626 }
0 commit comments