Skip to content

fix: skip oneOf outputSchema injection for MCP client compatibility - #169

Merged
neoneye merged 1 commit into
mainfrom
fix-oneof-output-schema
Mar 7, 2026
Merged

fix: skip oneOf outputSchema injection for MCP client compatibility#169
neoneye merged 1 commit into
mainfrom
fix-oneof-output-schema

Conversation

@neoneye

Copy link
Copy Markdown
Member

Summary

  • Skip injecting oneOf output schemas into FastMCP tools — MCP clients (e.g. Inspector) require outputSchema to have "type": "object" at top level and reject oneOf
  • Tools with multi-shape responses (plan_status, plan_file_info) work correctly without an advertised schema since structuredContent is always set
  • Follow-up to PR fix: plan_file_info returns empty for report artifact on HTTP server #166 which was merged without this fix

Test plan

  • All 68 tests pass (test_tool_surface_consistency.py, test_http_utils.py, test_plan_file_info_tool.py)
  • test_fastmcp_oneof_tools_have_no_output_schema verifies oneOf schemas are not advertised
  • test_fastmcp_flat_tools_use_canonical_output_schema verifies flat schemas are still injected
  • Manual: verify tools/list in MCP Inspector returns no validation errors

🤖 Generated with Claude Code

MCP clients (e.g. Inspector) require outputSchema to have "type": "object"
at top level. Tools with multi-shape responses (plan_status, plan_file_info)
use oneOf which clients reject with validation errors. Skip injecting these
schemas so the tools work without an advertised outputSchema.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@neoneye
neoneye merged commit 23e1f7c into mainMar 7, 2026
3 checks passed
@neoneye
neoneye deleted the fix-oneof-output-schema branch March 7, 2026 15:07
Sign up for freeto 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.

1 participant

@neoneye