fix: map checkbox and json_object types in MCP schema publishing#34226
Open
majiayu000 wants to merge 1 commit intolanggenius:mainfrom
Open
fix: map checkbox and json_object types in MCP schema publishing#34226majiayu000 wants to merge 1 commit intolanggenius:mainfrom
majiayu000 wants to merge 1 commit intolanggenius:mainfrom
Conversation
convert_input_form_to_parameters was missing branches for CHECKBOX and JSON_OBJECT, causing them to fall through without a type. Add boolean mapping for CHECKBOX and object mapping for JSON_OBJECT, with optional json_schema forwarding for field-level validation. Signed-off-by: majiayu000 <1835304752@qq.com>
Contributor
Pyrefly DiffNo changes detected. |
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.
Fixes #34199
Summary
convert_input_form_to_parameterswas mapping every input type to"string"in the JSON Schema it publishes to MCP clients. CHECKBOX and JSON_OBJECT inputs lost their real types, so MCP clients couldn't render proper boolean toggles or object editors.Added two elif branches after the existing SELECT handling:
VariableEntityType.CHECKBOX→"boolean"VariableEntityType.JSON_OBJECT→"object", forwardingproperties/required/additionalPropertiesfrom the entity'sjson_schemawhen presentSELECT wasn't changed since it already maps to
"string"+"enum", which is correct per JSON Schema. The dropdown rendering issue from the original report is a frontend concern tracked in #23285.Screenshots
N/A (backend-only schema change)
Checklist
make lintandmake type-check(backend) andcd web && npx lint-staged(frontend) to appease the lint gods