Title: OTel client span stays Unset when the tool result has isError: true · Issue #3810 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: OTel client span stays Unset when the tool result has isError: true · Issue #3810 · modelcontextprotocol/python-sdk
X Title: OTel client span stays Unset when the tool result has isError: true · Issue #3810 · modelcontextprotocol/python-sdk
Description: With mcp==2.3.0, the client span created in shared/jsonrpc_dispatcher.py sets ERROR status and error.type for a JSON-RPC error response (the #3174 fix), but not for a successful response whose CallToolResult.isError is true. The server s...
Open Graph Description: With mcp==2.3.0, the client span created in shared/jsonrpc_dispatcher.py sets ERROR status and error.type for a JSON-RPC error response (the #3174 fix), but not for a successful response whose Call...
X Description: With mcp==2.3.0, the client span created in shared/jsonrpc_dispatcher.py sets ERROR status and error.type for a JSON-RPC error response (the #3174 fix), but not for a successful response whose Call...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/3810
X: @github
Domain: redirect.github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OTel client span stays Unset when the tool result has isError: true","articleBody":"With `mcp==2.3.0`, the client span created in `shared/jsonrpc_dispatcher.py` sets ERROR status and `error.type` for a JSON-RPC error response (the #3174 fix), but not for a successful response whose `CallToolResult.isError` is true. The server span for the same call does set `error.type=tool_error` (`server/_otel.py`), so the two ends of one call disagree.\n\nThe OTel GenAI semantic conventions for MCP (`docs/gen-ai/mcp.md`, note on `error.type`) say instrumentation SHOULD set `error.type` to `tool_error` when the tool result reports an error.\n\n**Reproduction** (Python client and server, Streamable HTTP, default OTel setup):\n```\ngit clone https://github.com/mkwitko/mcp-reliability && cd mcp-reliability\nexamples/python-sdk-streamable-http/run.sh # needs docker, uv, go\ngo run ./cmd/mcp-reliability doctor testdata/python-sdk-default.jsonl\n```\nOutput includes:\n```\n[WARN] MCP-ERR-003: client and server spans for \"tools/call fail\" disagree on failure: the client span lacks error.type\n```\nCaptured trace and write-up: https://github.com/mkwitko/mcp-reliability/blob/v0.1.0/docs/research/python-sdk-v2-validation.md\n\n**Suggested change:** after the response is parsed in the dispatcher, if the result is a `CallToolResult` with `isError`, set `error.type=\"tool_error\"` and status ERROR on the client span, matching `server/_otel.py`. Happy to send a PR if you agree with the direction.\n","author":{"url":"https://github.com/mkwitko","@type":"Person","name":"mkwitko"},"datePublished":"2026-11-03T12:06:21Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3810"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9c3129df-f49f-d50b-9ea1-bb58b843e70f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C014:5662:22B00F3:2DA5CD0:6B055D27 |
| html-safe-nonce | 104db731f2fa63f070111f6a4b43af9174eb06e1044b4c63f474f9ec5574357c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDE0OjU2NjI6MjJCMDBGMzoyREE1Q0QwOjZCMDU1RDI3IiwidmlzaXRvcl9pZCI6IjQ3MTkxOTIwMjgwNTQxMTc2NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b8d2d473324bb23bdb80618a69406b5631749177fc96f7c510113bfc490b5786 |
| hovercard-subject-tag | issue:6182230138 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/3810/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a2a026e391a1122f58c19a42d4e03f68b28dbe95dc80b704b3f3c0f1d2bb205c/modelcontextprotocol/python-sdk/issues/3810 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a2a026e391a1122f58c19a42d4e03f68b28dbe95dc80b704b3f3c0f1d2bb205c/modelcontextprotocol/python-sdk/issues/3810 |
| og:image:alt | With mcp==2.3.0, the client span created in shared/jsonrpc_dispatcher.py sets ERROR status and error.type for a JSON-RPC error response (the #3174 fix), but not for a successful response whose Call... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mkwitko |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8a6760da3cce5e2d079d07e3b62df71194316c4478db1a5e38050f44fce72c72 |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8327739ac0648b9c3c722b5f401f7338553936b8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width