@@ -33,7 +33,7 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
33
33
mcp .WithString ("category" ,
34
34
mcp .Description ("Optional filter by discussion category ID. If provided, only discussions with this category are listed." ),
35
35
),
36
- WithUnifiedPagination (),
36
+ WithCursorPagination (),
37
37
),
38
38
func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
39
39
// Required params
@@ -53,7 +53,7 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
53
53
}
54
54
55
55
// Get pagination parameters and convert to GraphQL format
56
- pagination , err := OptionalPaginationParams (request )
56
+ pagination , err := OptionalCursorPaginationParams (request )
57
57
if err != nil {
58
58
return nil , err
59
59
}
@@ -305,7 +305,7 @@ func GetDiscussionComments(getGQLClient GetGQLClientFn, t translations.Translati
305
305
mcp .WithString ("owner" , mcp .Required (), mcp .Description ("Repository owner" )),
306
306
mcp .WithString ("repo" , mcp .Required (), mcp .Description ("Repository name" )),
307
307
mcp .WithNumber ("discussionNumber" , mcp .Required (), mcp .Description ("Discussion Number" )),
308
- WithUnifiedPagination (),
308
+ WithCursorPagination (),
309
309
),
310
310
func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
311
311
// Decode params
@@ -319,22 +319,21 @@ func GetDiscussionComments(getGQLClient GetGQLClientFn, t translations.Translati
319
319
}
320
320
321
321
// Get pagination parameters and convert to GraphQL format
322
- pagination , err := OptionalPaginationParams (request )
322
+ pagination , err := OptionalCursorPaginationParams (request )
323
323
if err != nil {
324
324
return nil , err
325
325
}
326
326
327
327
// Check if pagination parameters were explicitly provided
328
- _ , pageProvided := request .GetArguments ()["page" ]
329
328
_ , perPageProvided := request .GetArguments ()["perPage" ]
330
- paginationExplicit := pageProvided || perPageProvided
329
+ paginationExplicit := perPageProvided
331
330
332
331
paginationParams , err := pagination .ToGraphQLParams ()
333
332
if err != nil {
334
333
return nil , err
335
334
}
336
335
337
- // Use default of 100 if pagination was not explicitly provided
336
+ // Use default of 30 if pagination was not explicitly provided
338
337
if ! paginationExplicit {
339
338
defaultFirst := int32 (DefaultGraphQLPageSize )
340
339
paginationParams .First = & defaultFirst
@@ -419,7 +418,6 @@ func ListDiscussionCategories(getGQLClient GetGQLClientFn, t translations.Transl
419
418
mcp .Required (),
420
419
mcp .Description ("Repository name" ),
421
420
),
422
- WithUnifiedPagination (),
423
421
),
424
422
func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
425
423
// Decode params
@@ -431,28 +429,6 @@ func ListDiscussionCategories(getGQLClient GetGQLClientFn, t translations.Transl
431
429
return mcp .NewToolResultError (err .Error ()), nil
432
430
}
433
431
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
-
456
432
client , err := getGQLClient (ctx )
457
433
if err != nil {
458
434
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
472
448
EndCursor githubv4.String
473
449
}
474
450
TotalCount int
475
- } `graphql:"discussionCategories(first: $first, after: $after )"`
451
+ } `graphql:"discussionCategories(first: $first)"`
476
452
} `graphql:"repository(owner: $owner, name: $repo)"`
477
453
}
478
454
vars := map [string ]interface {}{
479
455
"owner" : githubv4 .String (params .Owner ),
480
456
"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 ),
487
458
}
488
459
if err := client .Query (ctx , & q , vars ); err != nil {
489
460
return mcp .NewToolResultError (err .Error ()), nil
0 commit comments