Repository navigation
fix: preserve additional properties in tool output schemas - #373
Merged
punkpeye merged 1 commit intoSep 11, 2026
Merged
Conversation
Keep advertised output schemas consistent with runtime validation so record and catchall results remain valid after tool discovery. Fixes punkpeye#372
|
🎉 This PR is included in version 4.20.11 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Closes #372.
A tool returning a warehouse-to-stock map can pass server-side validation and still fail at the client after
tools/list.strictJsonSchemareplaces the record'sadditionalProperties: { type: "number" }withfalse, so the advertised schema rejects every warehouse key.Preserve the converted output schema when listing tools. This keeps record, nested record, loose-object, and catchall results consistent with runtime validation. Explicitly strict output objects stay closed, and invalid output values still produce tool errors. Input schema handling is unchanged.
Add seven regression cases that discover the tool before calling it, and update the JSON Schema adapter's listing test and documentation to reflect the output contract.
Validation
vitest run): 785 passed.OPENAPI_NETWORK=1 vitest run src/openapi/fromOpenAPI.benchmark.test.ts src/openapi/fromOpenAPI.live.test.ts): 15 passed.