@@ -33,7 +33,7 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
3333 mcp .WithString ("category" ,
3434 mcp .Description ("Optional filter by discussion category ID. If provided, only discussions with this category are listed." ),
3535 ),
36- WithUnifiedPagination (),
36+ WithCursorPagination (),
3737 ),
3838 func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
3939 // Required params
@@ -53,7 +53,7 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
5353 }
5454
5555 // Get pagination parameters and convert to GraphQL format
56- pagination , err := OptionalPaginationParams (request )
56+ pagination , err := OptionalCursorPaginationParams (request )
5757 if err != nil {
5858 return nil , err
5959 }
@@ -305,7 +305,7 @@ func GetDiscussionComments(getGQLClient GetGQLClientFn, t translations.Translati
305305 mcp .WithString ("owner" , mcp .Required (), mcp .Description ("Repository owner" )),
306306 mcp .WithString ("repo" , mcp .Required (), mcp .Description ("Repository name" )),
307307 mcp .WithNumber ("discussionNumber" , mcp .Required (), mcp .Description ("Discussion Number" )),
308- WithUnifiedPagination (),
308+ WithCursorPagination (),
309309 ),
310310 func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
311311 // Decode params
@@ -319,22 +319,21 @@ func GetDiscussionComments(getGQLClient GetGQLClientFn, t translations.Translati
319319 }
320320
321321 // Get pagination parameters and convert to GraphQL format
322- pagination , err := OptionalPaginationParams (request )
322+ pagination , err := OptionalCursorPaginationParams (request )
323323 if err != nil {
324324 return nil , err
325325 }
326326
327327 // Check if pagination parameters were explicitly provided
328- _ , pageProvided := request .GetArguments ()["page" ]
329328 _ , perPageProvided := request .GetArguments ()["perPage" ]
330- paginationExplicit := pageProvided || perPageProvided
329+ paginationExplicit := perPageProvided
331330
332331 paginationParams , err := pagination .ToGraphQLParams ()
333332 if err != nil {
334333 return nil , err
335334 }
336335
337- // Use default of 100 if pagination was not explicitly provided
336+ // Use default of 30 if pagination was not explicitly provided
338337 if ! paginationExplicit {
339338 defaultFirst := int32 (DefaultGraphQLPageSize )
340339 paginationParams .First = & defaultFirst
@@ -419,7 +418,6 @@ func ListDiscussionCategories(getGQLClient GetGQLClientFn, t translations.Transl
419418 mcp .Required (),
420419 mcp .Description ("Repository name" ),
421420 ),
422- WithUnifiedPagination (),
423421 ),
424422 func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
425423 // Decode params
@@ -431,28 +429,6 @@ func ListDiscussionCategories(getGQLClient GetGQLClientFn, t translations.Transl
431429 return mcp .NewToolResultError (err .Error ()), nil
432430 }
433431
434- // Get pagination parameters and convert to GraphQL format
435- pagination , err := OptionalPaginationParams (request )
436- if err != nil {
437- return nil , err
438- }
439-
440- // Check if pagination parameters were explicitly provided
441- _ , pageProvided := request .GetArguments ()["page" ]
442- _ , perPageProvided := request .GetArguments ()["perPage" ]
443- paginationExplicit := pageProvided || perPageProvided
444-
445- paginationParams , err := pagination .ToGraphQLParams ()
446- if err != nil {
447- return nil , err
448- }
449-
450- // Use default of 100 if pagination was not explicitly provided
451- if ! paginationExplicit {
452- defaultFirst := int32 (DefaultGraphQLPageSize )
453- paginationParams .First = & defaultFirst
454- }
455-
456432 client , err := getGQLClient (ctx )
457433 if err != nil {
458434 return mcp .NewToolResultError (fmt .Sprintf ("failed to get GitHub GQL client: %v" , err )), nil
@@ -472,18 +448,13 @@ func ListDiscussionCategories(getGQLClient GetGQLClientFn, t translations.Transl
472448 EndCursor githubv4.String
473449 }
474450 TotalCount int
475- } `graphql:"discussionCategories(first: $first, after: $after )"`
451+ } `graphql:"discussionCategories(first: $first)"`
476452 } `graphql:"repository(owner: $owner, name: $repo)"`
477453 }
478454 vars := map [string ]interface {}{
479455 "owner" : githubv4 .String (params .Owner ),
480456 "repo" : githubv4 .String (params .Repo ),
481- "first" : githubv4 .Int (* paginationParams .First ),
482- }
483- if paginationParams .After != nil {
484- vars ["after" ] = githubv4 .String (* paginationParams .After )
485- } else {
486- vars ["after" ] = (* githubv4 .String )(nil )
457+ "first" : githubv4 .Int (25 ),
487458 }
488459 if err := client .Query (ctx , & q , vars ); err != nil {
489460 return mcp .NewToolResultError (err .Error ()), nil
0 commit comments