You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Summary
Fixed `MCPUtil.invoke_mcp_tool()` to return `"[]"` instead of logging an
error when MCP tools return empty content. Empty results (`None, []`)
are valid outputs and should be treated consistently with
function tools. The `None -> "[]"` and `[] -> "[]"` behavior comes from
the MCP Python SDK's[ FastMCP implementation](
https://github.com/modelcontextprotocol/python-sdk/blob/6566c08446ad37b66f1457532c7f5a14f243ae10/src/mcp/server/fastmcp/utilities/func_metadata.py#L500).
### Test plan
- Added comprehensive test coverage in
`test_mcp_fastmcp_behavior_verification()` that verifies all FastMCP
edge cases
- Enhanced FakeMCPServer to support custom content testing scenarios
- Ran full test suite - all tests pass
- Verified the fix handles `None, [], {}, [{}], [[]]` cases correctly
### Issue number
Closes#1035
### Checks
- [x] I've added new tests (if relevant)
- [ ] I've added/updated the relevant documentation
- [x] I've run `make lint` and `make format`
- [x] I've made sure tests pass
Co-authored-by: thein <[email protected]>
0 commit comments