@@ -613,12 +613,7 @@ func listBranches(client *github.Client, t translations.TranslationHelperFunc) (
613613 mcp .Required (),
614614 mcp .Description ("Repository name" ),
615615 ),
616- mcp .WithNumber ("page" ,
617- mcp .Description ("Page number" ),
618- ),
619- mcp .WithNumber ("perPage" ,
620- mcp .Description ("Results per page" ),
621- ),
616+ withPagination (),
622617 ),
623618 func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
624619 owner , err := requiredParam [string ](request , "owner" )
@@ -629,19 +624,15 @@ func listBranches(client *github.Client, t translations.TranslationHelperFunc) (
629624 if err != nil {
630625 return mcp .NewToolResultError (err .Error ()), nil
631626 }
632- page , err := optionalIntParamWithDefault (request , "page" , 1 )
633- if err != nil {
634- return mcp .NewToolResultError (err .Error ()), nil
635- }
636- perPage , err := optionalIntParamWithDefault (request , "per_page" , 30 )
627+ pagination , err := optionalPaginationParams (request )
637628 if err != nil {
638629 return mcp .NewToolResultError (err .Error ()), nil
639630 }
640631
641632 opts := & github.BranchListOptions {
642633 ListOptions : github.ListOptions {
643- Page : page ,
644- PerPage : perPage ,
634+ Page : pagination . page ,
635+ PerPage : pagination . perPage ,
645636 },
646637 }
647638
0 commit comments