@@ -727,12 +727,7 @@ func GetIssueTimeline(getClient GetClientFn, t translations.TranslationHelperFun
727727 mcp .Required (),
728728 mcp .Description ("Issue number" ),
729729 ),
730- mcp .WithNumber ("page" ,
731- mcp .Description ("Page number" ),
732- ),
733- mcp .WithNumber ("per_page" ,
734- mcp .Description ("Number of records per page" ),
735- ),
730+ WithPagination (),
736731 ),
737732 func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
738733 owner , err := requiredParam [string ](request , "owner" )
@@ -747,18 +742,15 @@ func GetIssueTimeline(getClient GetClientFn, t translations.TranslationHelperFun
747742 if err != nil {
748743 return mcp .NewToolResultError (err .Error ()), nil
749744 }
750- page , err := OptionalIntParamWithDefault (request , "page" , 1 )
751- if err != nil {
752- return mcp .NewToolResultError (err .Error ()), nil
753- }
754- perPage , err := OptionalIntParamWithDefault (request , "per_page" , 30 )
745+
746+ pagination , err := OptionalPaginationParams (request )
755747 if err != nil {
756748 return mcp .NewToolResultError (err .Error ()), nil
757749 }
758750
759751 opts := & github.ListOptions {
760- Page : page ,
761- PerPage : perPage ,
752+ Page : pagination . page ,
753+ PerPage : pagination . perPage ,
762754 }
763755
764756 client , err := getClient (ctx )
@@ -804,12 +796,7 @@ func GetIssueEvents(getClient GetClientFn, t translations.TranslationHelperFunc)
804796 mcp .Required (),
805797 mcp .Description ("Issue number" ),
806798 ),
807- mcp .WithNumber ("page" ,
808- mcp .Description ("Page number" ),
809- ),
810- mcp .WithNumber ("per_page" ,
811- mcp .Description ("Number of records per page" ),
812- ),
799+ WithPagination (),
813800 ),
814801 func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
815802 owner , err := requiredParam [string ](request , "owner" )
@@ -824,18 +811,15 @@ func GetIssueEvents(getClient GetClientFn, t translations.TranslationHelperFunc)
824811 if err != nil {
825812 return mcp .NewToolResultError (err .Error ()), nil
826813 }
827- page , err := OptionalIntParamWithDefault (request , "page" , 1 )
828- if err != nil {
829- return mcp .NewToolResultError (err .Error ()), nil
830- }
831- perPage , err := OptionalIntParamWithDefault (request , "per_page" , 30 )
814+
815+ pagination , err := OptionalPaginationParams (request )
832816 if err != nil {
833817 return mcp .NewToolResultError (err .Error ()), nil
834818 }
835819
836820 opts := & github.ListOptions {
837- Page : page ,
838- PerPage : perPage ,
821+ Page : pagination . page ,
822+ PerPage : pagination . perPage ,
839823 }
840824
841825 client , err := getClient (ctx )
0 commit comments