fix: add maximum_records parameter to paginate calls#63
Closed
rdgifford wants to merge 2 commits into
Closed
Conversation
Add missing maximum_records parameter to paginate() calls across all list operations. Without this parameter, the paginate function ignores the user's limit parameter and defaults to fetching up to 1000 records, causing excessive token usage. Affected tools: - schedules.py - oncalls.py - escalation_policies.py - teams.py (3 calls) - incidents.py (fixed fallback value) - services.py - event_orchestrations.py Updated test assertions in test_escalation_policies.py to expect the maximum_records parameter.
Update test assertions across all affected test files to expect the maximum_records parameter in paginate() calls. Tests now pass with same baseline as main (2 pre-existing failures in event_orchestrations).
Contributor
|
Closing — the
incidents.py (#144) already had All |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes pagination bug where user's limit parameter was ignored, causing excessive token usage in MCP responses.
The paginate() function has a maximum_records parameter that defaults to 1000, but most list operations weren't passing it. This meant user-specified limits were ignored.
Issue number: #62
Type of change
Checklist
Changes Made
Affected Tools
Test Results
All tests pass with same baseline as main: 2 failed, 194 passed
(The 2 failures are pre-existing event_orchestrations tests)
Impact
Before: User sets limit=5 but receives up to 1000 records
After: User sets limit=5 and receives exactly 5 records
Note: Evals not run as this is a pure bug fix that doesn't change tool descriptions or behavior.