Repository navigation
fix(mcp): type nullable OpenAPI params by their non-null type - #61
Open
Zernio-Elean wants to merge 1 commit into
Open
Zernio-Elean wants to merge 1 commit into
Zernio-Elean wants to merge 1 commit into
Conversation
Contributor
Author
pr-review round 1: APPROVEReviewer: opus, fresh context, diff of ea531d5 (92+ / 31-, 3 files)
|
OpenAPI 3.1 nullable params (type: [integer, 'null']) and oneOf branches with a null member fell to the str fallback in the MCP generator, so hosted MCP tools typed 26 params in 16 tools as strings. dedupe_same_text_hours on comment automations could not be set at all: FastMCP rejected 720 and the API rejected "720". Feedback: feedback_6ae7fd11c0c687e8c3135083
Zernio-Elean
force-pushed
the
fix/mcp-nullable-param-types
branch
from
November 7, 2026 11:17
ea531d5 to
b656bba
Compare
Contributor
Author
|
Opus review (fresh context) on head b656bba: APPROVE
|
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.
Why
The MCP generator maps OpenAPI 3.1 nullable types (
type: [integer, "null"]) andoneOfbranches with anullmember to thestrfallback. On the hosted MCP, 26 params in 16 tools are typed as strings.dedupe_same_text_hourson comment automations cannot be set at all: FastMCP rejects720and the API rejects"720".What
get_python_type: a listtyperesolves to its single non-null member; mixed types keep thestrfallback._resolve_schema:oneOf/anyOfdropsnullbefore collapsing, sodm_media,templateandbrandingbecome dicts.generated_tools.pyregenerated (generator plusruff format, no hand edits): only the 26 param lines and 5 docstring lines change.oneOfobject accepts a dict, and a mixed-type list staysstr.Follow-ups
null:_build_payloaddropsNone(separate fix).describe_nested_fieldsstill comparestypewith==, so nullable object/array params (placements, contact_info, quick_replies) list no keys in their docstring._resolve_schemadocstring (oneOf now drops null branches) and runruff formaton the new tests.Feedback: feedback_6ae7fd11c0c687e8c3135083