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: github.com
IPv4 address: 140.82.114.3
{"@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:34581cc6-41fa-0ac1-5265-6f254a522ff4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DBE0:2739CD:1F56D91:2A81057:6B05653F |
| html-safe-nonce | 0ec224f541e6bb6380d3a12304d6d13fc7718749f3933531befc27d6e0f4bdf8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQkUwOjI3MzlDRDoxRjU2RDkxOjJBODEwNTc6NkIwNTY1M0YiLCJ2aXNpdG9yX2lkIjoiNjc1NTI2MDI1NTg0NjA5ODIzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bc9da2afc69e1a935cb918b719185de9a3fce5f1cc85ea482eaabd7a927f4943 |
| 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 | 1be5cc09efdd4833c24a4ffa71d698e3999fa09071e159fe14c2c08e41c98331 |
| 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 | f6d69234e682c947a48074340e69d45d5901de31 |
| 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