@@ -53,9 +53,12 @@ func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelp
53
53
// Get pagination parameters and convert to GraphQL format
54
54
unifiedPagination , err := OptionalUnifiedPaginationParams (request )
55
55
if err != nil {
56
- return mcp .NewToolResultError (err .Error ()), nil
56
+ return nil , err
57
+ }
58
+ pagination , err := unifiedPagination .ToGraphQLParams ()
59
+ if err != nil {
60
+ return nil , err
57
61
}
58
- pagination := unifiedPagination .ToGraphQLParams ()
59
62
60
63
client , err := getGQLClient (ctx )
61
64
if err != nil {
@@ -276,15 +279,18 @@ func GetDiscussionComments(getGQLClient GetGQLClientFn, t translations.Translati
276
279
// Get unified pagination parameters and convert to GraphQL format
277
280
unifiedPagination , err := OptionalUnifiedPaginationParams (request )
278
281
if err != nil {
279
- return mcp . NewToolResultError ( err . Error ()), nil
282
+ return nil , err
280
283
}
281
284
282
285
// Check if pagination parameters were explicitly provided
283
- _ , pageProvided := request .Params . Arguments .( map [ string ] interface {} )["page" ]
284
- _ , perPageProvided := request .Params . Arguments .( map [ string ] interface {} )["perPage" ]
286
+ _ , pageProvided := request .GetArguments ( )["page" ]
287
+ _ , perPageProvided := request .GetArguments ( )["perPage" ]
285
288
paginationExplicit := pageProvided || perPageProvided
286
289
287
- paginationParams := unifiedPagination .ToGraphQLParams ()
290
+ paginationParams , err := unifiedPagination .ToGraphQLParams ()
291
+ if err != nil {
292
+ return nil , err
293
+ }
288
294
289
295
// Use default of 100 if pagination was not explicitly provided
290
296
if ! paginationExplicit {
@@ -366,15 +372,18 @@ func ListDiscussionCategories(getGQLClient GetGQLClientFn, t translations.Transl
366
372
// Get unified pagination parameters and convert to GraphQL format
367
373
unifiedPagination , err := OptionalUnifiedPaginationParams (request )
368
374
if err != nil {
369
- return mcp . NewToolResultError ( err . Error ()), nil
375
+ return nil , err
370
376
}
371
377
372
378
// Check if pagination parameters were explicitly provided
373
- _ , pageProvided := request .Params . Arguments .( map [ string ] interface {} )["page" ]
374
- _ , perPageProvided := request .Params . Arguments .( map [ string ] interface {} )["perPage" ]
379
+ _ , pageProvided := request .GetArguments ( )["page" ]
380
+ _ , perPageProvided := request .GetArguments ( )["perPage" ]
375
381
paginationExplicit := pageProvided || perPageProvided
376
382
377
- pagination := unifiedPagination .ToGraphQLParams ()
383
+ pagination , err := unifiedPagination .ToGraphQLParams ()
384
+ if err != nil {
385
+ return nil , err
386
+ }
378
387
379
388
// Use default of 100 if pagination was not explicitly provided
380
389
if ! paginationExplicit {
0 commit comments