@@ -1358,6 +1358,7 @@ const (
1358
1358
// DefaultClosingPRsLimit is the default number of closing PRs to return per issue
1359
1359
// Aligned with GitHub GraphQL API default of 100 items per page
1360
1360
DefaultClosingPRsLimit = 100
1361
+ MaxGraphQLPageSize = 250 // Maximum page size for GitHub GraphQL API
1361
1362
)
1362
1363
1363
1364
// FindClosingPullRequests creates a tool to find pull requests that closed specific issues
@@ -1386,7 +1387,11 @@ func FindClosingPullRequests(getGQLClient GetGQLClientFn, t translations.Transla
1386
1387
),
1387
1388
),
1388
1389
mcp .WithNumber ("limit" ,
1389
- mcp .Description ("Maximum number of closing PRs to return per issue (default: 100, max: 250)" ),
1390
+ mcp .Description (fmt .Sprintf (
1391
+ "Maximum number of closing PRs to return per issue (default: %d, max: %d)" ,
1392
+ DefaultClosingPRsLimit ,
1393
+ MaxGraphQLPageSize ,
1394
+ )),
1390
1395
),
1391
1396
mcp .WithBoolean ("includeClosedPrs" ,
1392
1397
mcp .Description ("Include closed/merged pull requests in results (default: false)" ),
@@ -1404,7 +1409,10 @@ func FindClosingPullRequests(getGQLClient GetGQLClientFn, t translations.Transla
1404
1409
mcp .Description ("Cursor for backward pagination (use with last)" ),
1405
1410
),
1406
1411
mcp .WithNumber ("last" ,
1407
- mcp .Description ("Number of results from end for backward pagination (max: 250)" ),
1412
+ mcp .Description (fmt .Sprintf (
1413
+ "Number of results from end for backward pagination (max: %d)" ,
1414
+ MaxGraphQLPageSize ,
1415
+ )),
1408
1416
),
1409
1417
),
1410
1418
func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
@@ -1415,11 +1423,11 @@ func FindClosingPullRequests(getGQLClient GetGQLClientFn, t translations.Transla
1415
1423
limitExplicitlySet = true
1416
1424
if limitFloat , ok := limitParam .(float64 ); ok {
1417
1425
limit = int (limitFloat )
1418
- if limit <= 0 || limit > 250 {
1419
- return mcp .NewToolResultError ("limit must be between 1 and 250 inclusive (GitHub GraphQL API maximum)" ), nil
1426
+ if limit <= 0 || limit > MaxGraphQLPageSize {
1427
+ return mcp .NewToolResultError (fmt . Sprintf ( "limit must be between 1 and %d inclusive (GitHub GraphQL API maximum)" , MaxGraphQLPageSize ) ), nil
1420
1428
}
1421
1429
} else {
1422
- return mcp .NewToolResultError ("limit must be a number between 1 and 250 (GitHub GraphQL API maximum)" ), nil
1430
+ return mcp .NewToolResultError (fmt . Sprintf ( "limit must be a number between 1 and %d (GitHub GraphQL API maximum)" , MaxGraphQLPageSize ) ), nil
1423
1431
}
1424
1432
}
1425
1433
@@ -1428,8 +1436,8 @@ func FindClosingPullRequests(getGQLClient GetGQLClientFn, t translations.Transla
1428
1436
if err != nil {
1429
1437
return mcp .NewToolResultError (fmt .Sprintf ("last parameter error: %s" , err .Error ())), nil
1430
1438
}
1431
- if last != 0 && (last <= 0 || last > 250 ) {
1432
- return mcp .NewToolResultError ("last must be between 1 and 250 inclusive for backward pagination (GitHub GraphQL API maximum)" ), nil
1439
+ if last != 0 && (last <= 0 || last > MaxGraphQLPageSize ) {
1440
+ return mcp .NewToolResultError (fmt . Sprintf ( "last must be between 1 and %d inclusive for backward pagination (GitHub GraphQL API maximum)" , MaxGraphQLPageSize ) ), nil
1433
1441
}
1434
1442
1435
1443
// Parse cursor parameters
0 commit comments