Skip to content

MCP integration records tool calls that return isError as successful #7890

Description

@4ktLuffy

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.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions