错误: MCP 工具结果忽略 isError, 失败被视为普通输出
作者: 2gg-bit创建于 2026年9月27日更新于 2026年9月27日
Problems and Reproducibility When the MCP server returns a tool execution failure with CallToolResult(isError=True, content=[TextContent(type="text", text="Permission denied")]), MCPClientTool.execute() ignores isError and constructs a ToolResult(output="Permission denied", error=None). Therefore, neither the caller nor the string returned by the model has a tool error marker. Failures with empty content are even displayed as "No output returned." The expected behavior is that protocol-level successful tool execution errors should be mapped to ToolResult.error, and clear error messages should be provided when there is no error text, along with the attached screenshot. The actual CallToolResult data structure used by the repository-frozen version of the MCP SDK, simulating a ClientSession, reproduces 3 failures in text errors, empty error content, and errors with images, while the original 4 tests pass. No external MCP service is connected.
内容来源: FoundationAgents/OpenManus