Title: Return -32602 for resource not found (SEP-2164) by Kludex · Pull Request #2920 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Return -32602 for resource not found (SEP-2164) by Kludex · Pull Request #2920 · modelcontextprotocol/python-sdk
X Title: Return -32602 for resource not found (SEP-2164) by Kludex · Pull Request #2920 · modelcontextprotocol/python-sdk
Description: Implements SEP-2164. Closes #2794. Reading a missing resource now returns JSON-RPC -32602 (invalid params) with the requested URI in error.data, instead of code 0 with no data, so clients can reliably distinguish not-found. Changes Add ResourceNotFoundError(ResourceError) (backward compatible - existing ResourceError catchers still work). ResourceManager.get_resource() raises it for an unmatched URI; template-creation failures now raise ResourceError instead of ValueError. _handle_read_resource() maps ResourceNotFoundError -> -32602 and other ResourceError -> -32603, both carrying {"uri": ...}. Resolves the SEP-2164 interaction-suite divergence and drops the matching conformance baseline entry, which now passes (3 passed, 0 failed). Breaking change documented in docs/migration.md. AI Disclaimer This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.
Open Graph Description: Implements SEP-2164. Closes #2794. Reading a missing resource now returns JSON-RPC -32602 (invalid params) with the requested URI in error.data, instead of code 0 with no data, so clients can relia...
X Description: Implements SEP-2164. Closes #2794. Reading a missing resource now returns JSON-RPC -32602 (invalid params) with the requested URI in error.data, instead of code 0 with no data, so clients can relia...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2920
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:d17f4c4c-b57b-da38-82d1-b06201ba29d1 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CA68:262F40:ACF485:E9F964:6A593339 |
| html-safe-nonce | 0a155b668c2a51dc2a3973de7744f8bb3d7dcd4981820b86e312af9b20d4227b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTY4OjI2MkY0MDpBQ0Y0ODU6RTlGOTY0OjZBNTkzMzM5IiwidmlzaXRvcl9pZCI6Ijg4MzM4MjMzNTgyMDQ4NTEwMDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c4ec48eecf822dafbf89ecade09668c0e79c2e39adde92219c8969c00bb5c10f |
| hovercard-subject-tag | pull_request:3903974445 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/modelcontextprotocol/python-sdk/pull/2920/files |
| twitter:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| og:image:alt | Implements SEP-2164. Closes #2794. Reading a missing resource now returns JSON-RPC -32602 (invalid params) with the requested URI in error.data, instead of code 0 with no data, so clients can relia... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9713946e7d87c4b631b5230769f749551d20527cc4872e8f1d2ec6a11bead090 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 858568d2992d2e6aac25cc4ebf5b46c83bbfd745 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width