Repository navigation
Pass numeric limits and array item values of tool schemas to clients - #1470
Merged
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Tool arguments are registered as a Zod shape built from the tool's JSON Schema. Numbers became a plain
z.number()and arraysz.array(z.any()), sominimum/maximumand an array's allowed values never reached the client's tool list and were never checked. The model then sent values the vendor refuses or that our own limits cut.Cloud, 11-02 08:00 to 11-03 08:00 UTC:
get_updateswithtimeout30 (schema maximum 25): 4 calls cut by the 30 s call limit.etsy_get_listingincludeswithInventory, which the schema does not allow: 8 errors in 5 workspaces.waitSecsabove its maximum of 45: 1.Changes
tool-schema.util.ts: numbers keepminimum,maximum,exclusiveMinimumandexclusiveMaximum(numeric values only); an array whoseitemslists allowed strings keeps that list. Everything else stays as before.Type
Testing
tool-schema.util.spec.ts, 5 new cases (inside the limits, outside each limit, item outside the list, limits in the listed schema, non-numeric limit ignored).cd packages/backend && npx jest src/mcp-server/tool-schema.util.spec.ts: 25 passed. The full suite runs in CI.kommo_list_eventslimit250 against the adapter's maximum of 100 (64 calls in one workspace). The model gets "at most 100" and calls again within the documented limit.Checklist
Deployment
Same in Cloud and self-hosted: it applies to every MCP server's tool registration and to the shared endpoint's argument check.
Related Issues
Found in the 2026-11-03 Cloud check.