Fix Kotlin nullable fields in MCP tool input schema#5997
Closed
qixiangme wants to merge 1 commit into
Closed
Conversation
Signed-off-by: LEE CHANGMIN <erang903@khu.ac.kr>
8aca08d to
e36c77a
Compare
Contributor
|
FYI The error is caused by a |
Contributor
Author
|
Thanks for the clarification. I'll keep an eye on the updated fix. |
sdeleuze
pushed a commit
to sdeleuze/spring-ai
that referenced
this pull request
May 11, 2026
See spring-projects#5997 Signed-off-by: LEE CHANGMIN <erang903@khu.ac.kr>
R3gardless
pushed a commit
to R3gardless/spring-ai
that referenced
this pull request
May 21, 2026
See spring-projects#5997 Signed-off-by: LEE CHANGMIN <erang903@khu.ac.kr> Signed-off-by: R3gardless <pidaoh@g.skku.edu>
R3gardless
pushed a commit
to R3gardless/spring-ai
that referenced
this pull request
May 21, 2026
Closes spring-projects#5997 Signed-off-by: Sébastien Deleuze <sdeleuze@users.noreply.github.com> Signed-off-by: R3gardless <pidaoh@g.skku.edu>
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 is related to #5978 and fixes the MCP Tools schema generation path for Kotlin nullable fields.
PR #5897 addresses the standard
@Toolschema path by registeringorg.springframework.ai.model.KotlinModuleinJsonSchemaGenerator. MCP tools useMcpJsonSchemaGeneratorfor method input schemas, so Kotlin nullable properties inside MCP tool parameter data classes could still be emitted as required in nested JSON Schema objects.This change applies the same conditional
KotlinModuleregistration pattern toMcpJsonSchemaGenerator, keeping the fix narrowly scoped to MCP tool input schema generation.Tests
The regression test verifies both sides of Kotlin requiredness behavior:
String? = nullandList<String>? = null, are not included in nestedrequiredarraysCommands run:
Related issue: Addresses the MCP Tools portion of #5978.