Skip to content

fix: preserve non-object types in referenced MCP schemas - #304

Merged
Eigenwise merged 1 commit into
Eigenwise:mainfrom
liangzhechen655:fix/mcp-non-object-definitions
Oct 10, 2026
Merged

Eigenwise merged 1 commit into
Eigenwise:mainfrom
liangzhechen655:fix/mcp-non-object-definitions

Conversation

@liangzhechen655

Copy link
Copy Markdown
Contributor

MCP schemas may reference strings, arrays or nullable values in $defs/definitions. The transformer currently builds an empty object model for every reference, so otherwise-valid scalar and array tool arguments fail validation.

Resolve non-object definitions through the existing field-type converter, retaining nested models for object definitions and the recursion cache. This also handles chained aliases and references used as array items. Nine regressions fail before the fix; the complete core suite passes afterward (392 passed, 3 credential-dependent skips, 93% coverage). Repository-wide Black and Flake8 checks pass.

@Eigenwise Eigenwise left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source check of fb23ab64fa8816f0d9485eb8ace065ceb82b0740: scalar, array and nullable references use the field-conversion path, while object models retain the existing cache behavior. The added direct and alias cases cover the reported issue.

Follow-up: normal repository CI passed 392 tests with 3 MiniMax integration skips, including the 9 new reference cases and 42 existing transformer cases. Black and Flake8 passed. Approved and merged. The resolver change overlaps #300; retain one implementation when reconciling that follow-up.

@Eigenwise Eigenwise left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked fb23ab64fa8816f0d9485eb8ace065ceb82b0740. The scalar, array, nullable and alias reference cases now use the field converter while object definitions retain their model/cache path. Normal repository CI passed: 392 tests, with 3 MiniMax integration skips, plus Black and Flake8. That includes the 9 new reference cases and 42 existing transformer cases. No blocking correctness finding remains.

@Eigenwise
Eigenwise merged commit 4d76610 into Eigenwise:main Oct 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants