Title: feat(server): MCP error responses must populate structuredContent.adcp_error.code (not just text) · Issue #509 · adcontextprotocol/adcp-client-python · GitHub
Open Graph Title: feat(server): MCP error responses must populate structuredContent.adcp_error.code (not just text) · Issue #509 · adcontextprotocol/adcp-client-python
X Title: feat(server): MCP error responses must populate structuredContent.adcp_error.code (not just text) · Issue #509 · adcontextprotocol/adcp-client-python
Description: Motivation When a platform method raises `AdcpError(code="MEDIA_BUY_NOT_FOUND", ...)`, the framework today projects it onto the MCP wire as a TEXT payload like `MEDIA_BUY_NOT_FOUND[media_buy_id]: ...`. The structured `CallToolResult.stru...
Open Graph Description: Motivation When a platform method raises `AdcpError(code="MEDIA_BUY_NOT_FOUND", ...)`, the framework today projects it onto the MCP wire as a TEXT payload like `MEDIA_BUY_NOT_FOUND[media_buy_id]: ....
X Description: Motivation When a platform method raises `AdcpError(code="MEDIA_BUY_NOT_FOUND", ...)`, the framework today projects it onto the MCP wire as a TEXT payload like `MEDIA_BUY_NOT_FOUND[media_...
Opengraph URL: https://github.com/adcontextprotocol/adcp-client-python/issues/509
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(server): MCP error responses must populate structuredContent.adcp_error.code (not just text)","articleBody":"## Motivation\n\nWhen a platform method raises \\`AdcpError(code=\\\"MEDIA_BUY_NOT_FOUND\\\", ...)\\`, the framework today projects it onto the MCP wire as a TEXT payload like \\`MEDIA_BUY_NOT_FOUND[media_buy_id]: ...\\`. The structured \\`CallToolResult.structuredContent.adcp_error.code\\` field that the AdCP wire spec defines is NOT populated.\n\nDocumented as a known limitation in \\`src/adcp/server/translate.py:246-250\\`:\n\n> Carries \\`isError=True\\` AND a structured \\`adcp_error\\` object on the same envelope — but \\`_make_error_result\\` (\\`mcp/server/lowlevel/server.py:467\\`) drops \\`structuredContent\\` for error results, so we can't reach...\n\n## Why this is biting us now\n\nThe AdCP storyboard runner's compliance checks include JSON-pointer assertions like \\`/adcp_error/code\\` to verify spec-conformant error responses. With the current text-only projection:\n\n- A seller correctly raising \\`MEDIA_BUY_NOT_FOUND\\` for an unknown media_buy_id passes the *behavioral* check (rejected the request)\n- But fails the *wire-shape* check (\\`/adcp_error/code\\` returns \\`actual: mcp_error\\` instead of \\`MEDIA_BUY_NOT_FOUND\\`)\n\nThis was just surfaced by the multi_platform_seller storyboard fix-pack (PR #508): residual storyboard failures aren't mock bugs — they're SDK wire-projection gaps. Every adopter using \\`adcp.server.serve\\` has the same gap.\n\n## Proposed fix\n\nMigrate the error-result construction to use FastMCP's path that preserves \\`structuredContent\\` on \\`isError=True\\` results. The framework should populate:\n\n\\`\\`\\`json\n{\n \\\"isError\\\": true,\n \\\"structuredContent\\\": {\n \\\"adcp_error\\\": {\n \\\"code\\\": \\\"MEDIA_BUY_NOT_FOUND\\\",\n \\\"message\\\": \\\"...\\\",\n \\\"recovery\\\": \\\"correctable\\\",\n \\\"field\\\": \\\"media_buy_id\\\",\n \\\"details\\\": { ... }\n }\n },\n \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"\u003chuman-readable fallback>\\\"}]\n}\n\\`\\`\\`\n\nWhere the structured fields are derived from the raised \\`AdcpError\\` instance.\n\n## Acceptance criteria\n\n- [ ] \\`AdcpError\\` raised from any platform method projects to \\`structuredContent.adcp_error\\` with all spec-defined fields (\\`code\\`, \\`message\\`, \\`recovery\\`, optional \\`field\\`/\\`details\\`)\n- [ ] Storyboard runner's \\`/adcp_error/code\\` JSON-pointer assertions pass for correctly-raised errors\n- [ ] Text fallback in \\`content[]\\` preserved for human-readable display\n- [ ] Existing tests stay green\n- [ ] Reference: storyboard runner artifacts from multi_platform_seller showing \\`actual: mcp_error\\` failures\n\n## Refs\n\n- Documented limitation: \\`src/adcp/server/translate.py:246-250\\`\n- Surfacing context: PR #508 (multi_platform_seller storyboard fix-pack) — agent ran into this when verifying wire-conformance of correctly-raised errors\n- Upstream issue: adcp-client#1527 (storyboard runner UX) — once this lands, the storyboard runner's structured error checks become useful as a regression gate","author":{"url":"https://github.com/bokelley","@type":"Person","name":"bokelley"},"datePublished":"2026-05-04T00:56:13Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/509"}
| 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:7b8547c5-a066-044e-ca5f-1e3d8801b194 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9AFC:21E3E7:CBF899:10E6A4E:6B00F6CA |
| html-safe-nonce | 2b67b629cac738f10ae6b02606f84097921abe3487c6e24e1411394c5ef26763 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUZDOjIxRTNFNzpDQkY4OTk6MTBFNkE0RTo2QjAwRjZDQSIsInZpc2l0b3JfaWQiOiI2ODM3MzQ3NDIzMTUzNjE2NTg2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 59af41511b95194d809400b37fdf54c353fcf28b143d6cda95bb78737efc96e3 |
| hovercard-subject-tag | issue:4373463108 |
| 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/adcontextprotocol/adcp-client-python/509/issue_layout |
| twitter:image | https://opengraph.githubassets.com/43755aa9b2b5c322e66a2b73bb2477757e2fbe1bcfc58f592a16fb467a92e168/adcontextprotocol/adcp-client-python/issues/509 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/43755aa9b2b5c322e66a2b73bb2477757e2fbe1bcfc58f592a16fb467a92e168/adcontextprotocol/adcp-client-python/issues/509 |
| og:image:alt | Motivation When a platform method raises `AdcpError(code="MEDIA_BUY_NOT_FOUND", ...)`, the framework today projects it onto the MCP wire as a TEXT payload like `MEDIA_BUY_NOT_FOUND[media_buy_id]: .... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bokelley |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/adcontextprotocol/adcp-client-python git https://github.com/adcontextprotocol/adcp-client-python.git |
| octolytics-dimension-user_id | 221690821 |
| octolytics-dimension-user_login | adcontextprotocol |
| octolytics-dimension-repository_id | 1090305973 |
| octolytics-dimension-repository_nwo | adcontextprotocol/adcp-client-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1090305973 |
| octolytics-dimension-repository_network_root_nwo | adcontextprotocol/adcp-client-python |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width