Skip to content

Commit 34b53db

Browse files
authored
Adjust for actual GitHub API limits
1 parent 02f356d commit 34b53db

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkg/github/issues.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,8 @@ type ClosingPullRequest struct {
13561356

13571357
const (
13581358
// DefaultClosingPRsLimit is the default number of closing PRs to return per issue
1359-
DefaultClosingPRsLimit = 10
1359+
// Aligned with GitHub GraphQL API default of 100 items per page
1360+
DefaultClosingPRsLimit = 100
13601361
)
13611362

13621363
// FindClosingPullRequests creates a tool to find pull requests that closed specific issues
@@ -1414,11 +1415,11 @@ func FindClosingPullRequests(getGQLClient GetGQLClientFn, t translations.Transla
14141415
limitExplicitlySet = true
14151416
if limitFloat, ok := limitParam.(float64); ok {
14161417
limit = int(limitFloat)
1417-
if limit <= 0 || limit > 100 {
1418-
return mcp.NewToolResultError("limit must be between 1 and 100 inclusive"), nil
1418+
if limit <= 0 || limit > 250 {
1419+
return mcp.NewToolResultError("limit must be between 1 and 250 inclusive (GitHub GraphQL API maximum)"), nil
14191420
}
14201421
} else {
1421-
return mcp.NewToolResultError("limit must be a number between 1 and 100"), nil
1422+
return mcp.NewToolResultError("limit must be a number between 1 and 250 (GitHub GraphQL API maximum)"), nil
14221423
}
14231424
}
14241425

@@ -1427,8 +1428,8 @@ func FindClosingPullRequests(getGQLClient GetGQLClientFn, t translations.Transla
14271428
if err != nil {
14281429
return mcp.NewToolResultError(fmt.Sprintf("last parameter error: %s", err.Error())), nil
14291430
}
1430-
if last != 0 && (last <= 0 || last > 100) {
1431-
return mcp.NewToolResultError("last must be between 1 and 100 inclusive for backward pagination"), nil
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
14321433
}
14331434

14341435
// Parse cursor parameters

0 commit comments

Comments
 (0)