{"slug":"client-result-comparison","verifiedAt":"2026-11-10T02:01:58.641Z","environment":{"sdk":"1.30.0","clientSdk":"2.0.0","zod":"4.5.4","node":"v24.22.0","platform":"darwin/arm64","transport":"Streamable HTTP (stateless JSON response, 127.0.0.1)"},"evidenceUrl":"https://www.niubiagent.com/lab/client-result-comparison.json","scriptUrl":"https://www.niubiagent.com/lab/compare-clients.mjs","reproduction":"mkdir -p niubiagent-client-comparison && cd niubiagent-client-comparison\nnpm install --prefix . --ignore-scripts --no-audit --no-fund @modelcontextprotocol/sdk@1.30.0 @modelcontextprotocol/client@2.0.0 zod@4.5.4\ncurl -fsSLo compare-clients.mjs https://www.niubiagent.com/lab/compare-clients.mjs\nnode compare-clients.mjs","title":{"en":"MCP 1.30 and 2.0 clients handling a tool error","zh":"MCP 1.30 和 2.0 客户端如何处理工具错误"},"question":{"en":"Does moving from the 1.30.0 SDK client to the 2.0.0 client change how a missing lookup is reported?","zh":"从 1.30.0 SDK 客户端切换到 2.0.0 客户端后，查询缺失键会返回怎样的结果？"},"summary":{"en":"Both clients resolved a successful lookup and a tool-reported error against the same SDK 1.30.0 server. All four requests returned HTTP 200. The two missing-key results carried isError: true.","zh":"两个客户端访问同一个 SDK 1.30.0 服务端，分别查询已有键和缺失键。四次请求均返回 HTTP 200。两次缺失键查询都正常返回带有 isError: true 的工具结果。"},"interpretation":{"en":"In this migration scenario a caller can inspect isError after awaiting callTool in either package. Checking the HTTP status or handling only thrown exceptions misses the tool failure.","zh":"在这个迁移场景中，两种客户端都可在 callTool 返回后读取 isError。仅检查 HTTP 状态或捕获抛出的异常会遗漏工具报告的错误。"},"limitations":{"en":"Two official TypeScript packages were run in one Node process against the same local stateless fixture. The tested server chose the tool error flags. Desktop hosts, streaming reconnects and other server or protocol versions require their own runs.","zh":"本实验在同一个 Node 进程内运行两个官方 TypeScript 客户端包，连接本机无状态测试服务。错误标志由这个服务端设置。桌面宿主、流式重连及其他服务端或协议版本需要单独测试。"},"tags":["MCP","TypeScript SDK","client migration","tools/call","HTTP 200","isError","2.0.0","SDK 升级","客户端迁移"],"observations":[{"label":{"en":"@modelcontextprotocol/sdk 1.30.0 · known / missing isError","zh":"@modelcontextprotocol/sdk 1.30.0 · 已有键 / 缺失键 isError"},"value":"false / true"},{"label":{"en":"@modelcontextprotocol/client 2.0.0 · known / missing isError","zh":"@modelcontextprotocol/client 2.0.0 · 已有键 / 缺失键 isError"},"value":"false / true"},{"label":{"en":"MCP protocol header on tool requests","zh":"工具请求的 MCP 协议头"},"value":"2025-11-25"}],"sources":[{"label":"MCP TypeScript SDK","url":"https://github.com/modelcontextprotocol/typescript-sdk"},{"label":"MCP specification · Tools","url":"https://modelcontextprotocol.io/specification/2025-11-25/server/tools"}],"url":"https://www.niubiagent.com/lab/client-result-comparison","zhUrl":"https://www.niubiagent.com/zh/lab/client-result-comparison","jsonUrl":"https://www.niubiagent.com/api/lab/client-result-comparison.json","markdownUrl":"https://www.niubiagent.com/lab/client-result-comparison.md","requestCoverageUrl":"https://www.niubiagent.com/pilot?case=client-result-comparison"}