Repository navigation
fix: Reject limit below 1 on the run, dataset and store list tools - #1582
Merged
Merged
Conversation
get-actor-run-list, get-dataset-list and get-key-value-store-list took limit 0, negative and fractional values. apify-client drops limit 0, so the API returned its 1,000-item default page. The three limit schemas now require an integer of at least 1, as get-actor-build-list and get-actor-list do; invalid values fail validation before any request. Closes #1479 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CPzYK17FoL2F3cuVonqnej
jirispilka
marked this pull request as ready for review
October 14, 2026 11:21
RobertCrupa
approved these changes
Oct 15, 2026
jirispilka
pushed a commit
that referenced
this pull request
Oct 15, 2026
…med-filter Conflicts in the dataset and key-value store list tests: kept this branch's named/empty-page tests and master's limit validation tests from #1582, which replace the old "rejects limit above N" test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CPzYK17FoL2F3cuVonqnej
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.
Why
Closes #1479.
get-actor-run-list,get-dataset-listandget-key-value-store-listacceptedlimit: 0. apify-client drops a zero limit, so the API returned its default page of up to 1,000 items from tools that caplimitat 10 or 20.What changed
limitin the three schemas gets.int().min(1), as inget-actor-listandget-actor-build-list. Defaults and maximums are unchanged (runs 10/10, datasets 10/20, stores 10/10).Tool contract change: in
tools/list,limitgoes from{"type":"number","maximum":N,"default":10}to{"type":"integer","minimum":1,"maximum":N,"default":10}. Zero, negative and fractional values (andnull, which AJV coerces to 0) now fail validation with-32602before any API request.Notes for reviewers (human-written)
Proof it works
mcpc against two local stdio builds (master and this branch, 0.18.3),
--tools runs,storage:limitget-actor-run-listlimit: 1000, 786 runs-32602/limit: must be >= 1get-dataset-listlimit: 1000, 11 datasets-32602/limit: must be >= 1get-key-value-store-listlimit: 1000, 18 stores-32602/limit: must be >= 1limitto not be negative"-32602/limit: must be >= 1limit: 1-32602/limit: must be integerlimit: 1Unit tests (failed on master for 0, -1 and 1.5): per-tool AJV boundaries (0, -1, 1.5, max+1 rejected; 1, max and omitted accepted), and a
tools/calltest per tool showing-32602with noruns()/datasets()/keyValueStores()call, withlimit: 1as a control that does reach the client.Same class, not changed here:
get-key-value-store-keyslimit,get-dataset-schemalimit, andoffseton these three tools.AI-assisted: Claude Code wrote the change, tests and this description, and ran the mcpc probe. Issue reported by @ondraulehla.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CPzYK17FoL2F3cuVonqnej
Generated by Claude Code