Repository navigation
Conversation
Signed-off-by: bbdu3 <ergouyang854@gmail.com>
bbdu3
requested review from
CodeWithKyrian,
Nyholm,
chr-hertel and
soyuka
as code owners
November 23, 2026 03:09
This branch has not been deployed
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.
Summary
This PR adds support for JSON Schema 2020-12 numeric values for exclusiveMinimum and exclusiveMaximum, while maintaining backward compatibility with existing boolean configurations.
Fixes #754.
Previously:
produced:
{"minimum": 0, "exclusiveMinimum": true}It now produces:
{"minimum": 0, "exclusiveMinimum": 0}Direct numeric configuration is also supported:
Motivation and Context
MCP defaults to JSON Schema 2020-12 when a schema does not declare another dialect. In this dialect, both exclusive-bound keywords require numeric values.
The SDK previously declared these attribute settings as booleans and emitted them unchanged. Strict validators such as Ajv 2020 reject the resulting schemas, including configurations using
false. The SDK’s default Opis validator accepts the legacy boolean form through a compatibility option, which masked the interoperability problem.Changes
int|float|bool|nullfor both exclusive-bound settings.truebecomes the corresponding numericminimumormaximum.falseremoves the exclusive-bound keyword while retaining any inclusive bound.InvalidArgumentExceptionduring schema generation whentruehas no corresponding numeric bound after merging.definitionoverrides without converting their contents.Testing
2025-11-25and2026-07-28completed 32 valid/invalid tool calls across numeric, legacy, inclusive and inherited bounds.git diff --check: passed.Compatibility
Existing boolean configurations with valid corresponding bounds remain supported.
Two compatibility implications are recorded in the changelog:
trueflag without a corresponding numeric bound now fails during schema generation instead of being silently ignored.int|float|bool|nulltype.