Version
2.71.0 (master @ 6a4eb20)
Steps to Reproduce
Call an MCPServer (mcp 2.3.0) tool that raises ValueError, with MCPIntegration enabled.
Expected Result
The client gets isError: true and the tools/call span is marked as an error.
Actual Result
The client gets isError: true, but the span status stays ok, there is no error.type, and the MCP integration captures no error, so MCP tool error rates read 0%.
The mcp 2.x middleware never reads result["isError"] (mcp.py#L457-L501), and the mcp 1.x wrapper ignores a returned CallToolResult(isError=True) (mcp.py#L357-L395). Affected: raised errors on mcp 2.3.0 and fastmcp 4.0.11, and returned isError results on mcp 1.30.0.
I'd like to open a PR to fix this, with tests, if that's okay with you.
Version
2.71.0 (master @ 6a4eb20)
Steps to Reproduce
Call an
MCPServer(mcp 2.3.0) tool that raisesValueError, withMCPIntegrationenabled.Expected Result
The client gets
isError: trueand thetools/callspan is marked as an error.Actual Result
The client gets
isError: true, but the span status stays ok, there is noerror.type, and the MCP integration captures no error, so MCP tool error rates read 0%.The mcp 2.x middleware never reads
result["isError"](mcp.py#L457-L501), and the mcp 1.x wrapper ignores a returnedCallToolResult(isError=True)(mcp.py#L357-L395). Affected: raised errors on mcp 2.3.0 and fastmcp 4.0.11, and returnedisErrorresults on mcp 1.30.0.I'd like to open a PR to fix this, with tests, if that's okay with you.