Skip to content

fix: preserve MCP tool params when MCP schemas are rendered as allOf#459

Merged
jahooma merged 1 commit intoCodebuffAI:mainfrom
sonwr:fix/mcp-allof-params-rendering
Mar 9, 2026
Merged

fix: preserve MCP tool params when MCP schemas are rendered as allOf#459
jahooma merged 1 commit intoCodebuffAI:mainfrom
sonwr:fix/mcp-allof-params-rendering

Conversation

@sonwr
Copy link
Copy Markdown
Contributor

@sonwr sonwr commented Mar 8, 2026

This fixes MCP tool parameter rendering when the schema is valid but represented as allOf after Codebuff combines it with the end-step flag.

What was happening:

  • MCP returned a valid input schema
  • Codebuff converted the schema and combined it with the end-step flag
  • The resulting JSON Schema could be represented as allOf
  • paramsSection() only checked top-level properties, so it incorrectly rendered the tool as having no params

What changed:

  • Treat schemas with allOf, anyOf, oneOf, or non-empty required as meaningful
  • Keep rendering the full JSON Schema instead of falling back to Params: None

How I tested it:

  • Reproduced locally with a FastMCP server matching issue MCP dropping all input schemas #450
  • Before the fix, the MCP tool description rendered Params: None
  • After the fix, the rendered schema includes the expected name parameter
  • Added a regression test covering the allOf case

Fixes #450

@jahooma
Copy link
Copy Markdown
Contributor

jahooma commented Mar 9, 2026

Nice, thanks for the fix!

@jahooma jahooma merged commit b46ac0d into CodebuffAI:main Mar 9, 2026
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.

MCP dropping all input schemas

2 participants