René's URL Explorer Experiment


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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:fa748926-d53c-4dc5-0d28-fd856148b3d9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCF9E:1EE61A:11E52EC:1997448:6A5A180E
html-safe-nonce9c167ce75faf4544fd9927f03f4ae3fdfbbcb2c674f267c985ad681e020be248
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjlFOjFFRTYxQToxMUU1MkVDOjE5OTc0NDg6NkE1QTE4MEUiLCJ2aXNpdG9yX2lkIjoiMzAxMDg0ODEyNzI2NjE5OTU2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfdd035de7d6a4df01b4e3a9bf978b9b62e698dfdd2379b2701bc8dc51fc253e5
hovercard-subject-tagpull_request:3935636550
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2968/files
twitter:imagehttps://avatars.githubusercontent.com/u/224885523?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/224885523?s=400&v=4
og:image:altStacks 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None8c2fe7351e4e987cb8f75e2425a0b895d807779bc4c2d3c312be0a54082219f7
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release501ec24a694e4933bb3d70e768b1461c0def57a2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2968%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2968%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files
modelcontextprotocol https://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Fork 3.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Star 23.6k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Code https://github.com/modelcontextprotocol/python-sdk
Issues 255 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 303 https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality 6 https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Code https://github.com/modelcontextprotocol/python-sdk
Issues https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
maxisbeyhttps://github.com/maxisbey
mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
client-mrtr-call-toolhttps://github.com/modelcontextprotocol/python-sdk/tree/client-mrtr-call-tool
Conversation 11 https://github.com/modelcontextprotocol/python-sdk/pull/2968
Commits 6 https://github.com/modelcontextprotocol/python-sdk/pull/2968/commits
Checks 36 https://github.com/modelcontextprotocol/python-sdk/pull/2968/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/2968/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files
Client call_tool: input_responses/request_state retry params; InputRequiredResult via allow_input_required https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#top
Show all changes 6 commits https://github.com/modelcontextprotocol/python-sdk/pull/2968/files
d9a6317 Client call_tool: accept input_responses/request_state; return InputR… maxisbey Jun 25, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2968/commits/d9a6317306c7f4f66d756aa2f47da937093475a1
473f09c docs/migration: note ClientSession.call_tool union return maxisbey Jun 25, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2968/commits/473f09c05fdf9114c7d1b68228e8439d6030dacb
0b4d8a9 Retag call_tool driver placeholder TODO to L84 maxisbey Jun 25, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2968/commits/0b4d8a9a7088df190ea721dc18534ed7f67caa47
18559fe Move allow_input_required overload+gate down to ClientSession.call_tool maxisbey Jun 25, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2968/commits/18559fe6e7c822183316603e663582fc8a1df958
78b1f9d send_request: pass by_name=False on the TypeAdapter branch maxisbey Jun 25, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2968/commits/78b1f9d30012e4b1003f0f2e72b6cb5b4bc1e1a1
68fbef9 call_tool overloads: collapse to Literal[False] + bool on all three l… maxisbey Jun 25, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2968/commits/68fbef9e375deb6f6cfe04862eadf5d0c5cb735a
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/2968/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files
migration.md https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
client.py https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-34e945ebc2fea8a427b8d0c45ccd28eb4e4cceb33c82048bd7998e6bb2f754f3
session.py https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
session_group.py https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-cbe797d477654047e3091f5e3c0a1046d9197e34ed55d884c7d957ef4e61d775
test_session.py https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-623490a9c2dd576cc59e89f8d51f64acfffdeaad940e0bd4a0a51a50bc30d92d
test_session_group.py https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-5278bd22bb86f5828e6bd1d889dd74bd0cd7302c9d1eb56c01075b5fe193a232
docs/migration.mdhttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
View file https://github.com/modelcontextprotocol/python-sdk/blob/68fbef9e375deb6f6cfe04862eadf5d0c5cb735a/docs/migration.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2968/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d
src/mcp/client/client.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-34e945ebc2fea8a427b8d0c45ccd28eb4e4cceb33c82048bd7998e6bb2f754f3
View file https://github.com/modelcontextprotocol/python-sdk/blob/68fbef9e375deb6f6cfe04862eadf5d0c5cb735a/src/mcp/client/client.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2968/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-34e945ebc2fea8a427b8d0c45ccd28eb4e4cceb33c82048bd7998e6bb2f754f3
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-34e945ebc2fea8a427b8d0c45ccd28eb4e4cceb33c82048bd7998e6bb2f754f3
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-34e945ebc2fea8a427b8d0c45ccd28eb4e4cceb33c82048bd7998e6bb2f754f3
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-34e945ebc2fea8a427b8d0c45ccd28eb4e4cceb33c82048bd7998e6bb2f754f3
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-34e945ebc2fea8a427b8d0c45ccd28eb4e4cceb33c82048bd7998e6bb2f754f3
src/mcp/client/session.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
View file https://github.com/modelcontextprotocol/python-sdk/blob/68fbef9e375deb6f6cfe04862eadf5d0c5cb735a/src/mcp/client/session.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2968/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-634d1abcb8bda1a784f31e3431a10124e387f487dd243a54244515b4972aa0ee
src/mcp/client/session_group.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-cbe797d477654047e3091f5e3c0a1046d9197e34ed55d884c7d957ef4e61d775
View file https://github.com/modelcontextprotocol/python-sdk/blob/68fbef9e375deb6f6cfe04862eadf5d0c5cb735a/src/mcp/client/session_group.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2968/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-cbe797d477654047e3091f5e3c0a1046d9197e34ed55d884c7d957ef4e61d775
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-cbe797d477654047e3091f5e3c0a1046d9197e34ed55d884c7d957ef4e61d775
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-cbe797d477654047e3091f5e3c0a1046d9197e34ed55d884c7d957ef4e61d775
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-cbe797d477654047e3091f5e3c0a1046d9197e34ed55d884c7d957ef4e61d775
tests/client/test_session.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-623490a9c2dd576cc59e89f8d51f64acfffdeaad940e0bd4a0a51a50bc30d92d
View file https://github.com/modelcontextprotocol/python-sdk/blob/68fbef9e375deb6f6cfe04862eadf5d0c5cb735a/tests/client/test_session.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2968/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-623490a9c2dd576cc59e89f8d51f64acfffdeaad940e0bd4a0a51a50bc30d92d
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-623490a9c2dd576cc59e89f8d51f64acfffdeaad940e0bd4a0a51a50bc30d92d
https://github.com/modelcontextprotocol/python-sdk/pull/2968/files#diff-623490a9c2dd576cc59e89f8d51f64acfffdeaad940e0bd4a0a51a50bc30d92d
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2968/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.