Title: Client call_tool: input_responses/request_state retry params; InputRequiredResult via allow_input_required by maxisbey · Pull Request #2968 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Client call_tool: input_responses/request_state retry params; InputRequiredResult via allow_input_required by maxisbey · Pull Request #2968 · modelcontextprotocol/python-sdk
X Title: Client call_tool: input_responses/request_state retry params; InputRequiredResult via allow_input_required by maxisbey · Pull Request #2968 · modelcontextprotocol/python-sdk
Description: Stacks on s3-client-modern-path (#2950). Widens the client-side call_tool path so an InputRequiredResult can pass through and the caller can retry with input_responses / request_state. Changes ClientSession.send_request — result_type now accepts TypeAdapter[T] alongside type[T], so callers can parse a union result. All existing single-class callers are unchanged. ClientSession.call_tool (mechanics layer) — adds input_responses= / request_state= retry kwargs and returns CallToolResult | InputRequiredResult (matching MONOLITH_RESULTS["tools/call"]). Output-schema validation is gated on isinstance(result, CallToolResult). Client.call_tool / ClientSessionGroup.call_tool (policy layer) — @overload on allow_input_required: the default (False) still returns CallToolResult so existing callers are unaffected; allow_input_required=True returns the union. With the default, an InputRequiredResult raises RuntimeError with a retry steer — # TODO(L80) marks where the auto-loop driver replaces this. Direct ClientSession.call_tool callers — examples and tests that bypass Client now narrow with isinstance(result, CallToolResult). README.v2.md is regenerated from the updated snippets. Not in this PR get_prompt / read_resource widening — mechanically identical, follow separately. Auto-loop driver (the allow_input_required=False default will resolve InputRequiredResult automatically once it lands). InputRequiredResult at-least-one-of validator — already on main via #2967; lands here on rebase. Conformance sep-2322-client-request-state already exists upstream at the pinned conformance build; it's currently waived in expected-failures*.yml. Un-waiving + adding the @register handler in .github/actions/conformance/client.py is the burndown step once this is on main. Part of #2891. AI Disclaimer
Open Graph Description: Stacks on s3-client-modern-path (#2950). Widens the client-side call_tool path so an InputRequiredResult can pass through and the caller can retry with input_responses / request_state. Changes Clie...
X Description: Stacks on s3-client-modern-path (#2950). Widens the client-side call_tool path so an InputRequiredResult can pass through and the caller can retry with input_responses / request_state. Changes Clie...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2968
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:fa748926-d53c-4dc5-0d28-fd856148b3d9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CF9E:1EE61A:11E52EC:1997448:6A5A180E |
| html-safe-nonce | 9c167ce75faf4544fd9927f03f4ae3fdfbbcb2c674f267c985ad681e020be248 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjlFOjFFRTYxQToxMUU1MkVDOjE5OTc0NDg6NkE1QTE4MEUiLCJ2aXNpdG9yX2lkIjoiMzAxMDg0ODEyNzI2NjE5OTU2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fdd035de7d6a4df01b4e3a9bf978b9b62e698dfdd2379b2701bc8dc51fc253e5 |
| hovercard-subject-tag | pull_request:3935636550 |
| 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/2968/files |
| twitter:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| og:image:alt | Stacks on s3-client-modern-path (#2950). Widens the client-side call_tool path so an InputRequiredResult can pass through and the caller can retry with input_responses / request_state. Changes Clie... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8c2fe7351e4e987cb8f75e2425a0b895d807779bc4c2d3c312be0a54082219f7 |
| 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 | 501ec24a694e4933bb3d70e768b1461c0def57a2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width