enh: structured output go brr#409
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the tool filtering logic to clear output schemas from string-wrapped tools, ensuring cleaner content block display. The change addresses issue #273 by preventing tools from returning output in the format {"result": "..."} when a simple string response is more appropriate.
Changes:
- Updated
filter_server_toolsto perform a two-pass process: first removing disabled tools, then clearing output schemas - Added logic to identify and clear output schemas for string-wrapped tools marked with
x-fastmcp-wrap-result - Enhanced logging to report both tool removal and schema clearing operations
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a normalization step to the tool registry that clears output schemas for tools returning wrapped string results, exposes Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…workspace_mcp into issues/273 # Conflicts: # core/tool_registry.py
|
Closing — stale for 7 weeks, cleaning up branches. |
Closes #273
Fix content blocks display for string-returning tools
Problem
Tool results displayed as wrapped JSON instead of clean content blocks:
{"result": "Found 15 files for user..."}Solution
Clear output_schema on tools with x-fastmcp-wrap-result flag during tool registration. FastMCP now returns clean TextContent
blocks per MCP spec:
Changes
Result
Claude Code now displays tool output with proper formatting and expandable sections instead of JSON blobs.
Summary by CodeRabbit
Bug Fixes
Tests