Title: feat(client): add _meta support to call_tool for tool calls\n\n- Adds… by pyrotank41 · Pull Request #1003 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: feat(client): add _meta support to call_tool for tool calls\n\n- Adds… by pyrotank41 · Pull Request #1003 · modelcontextprotocol/python-sdk
X Title: feat(client): add _meta support to call_tool for tool calls\n\n- Adds… by pyrotank41 · Pull Request #1003 · modelcontextprotocol/python-sdk
Description: Adds optional _meta parameter support to ClientSession.call_tool and ClientSessionGroup.call_tool methods, enabling users to pass request metadata (such as progress tokens or user context) in a clean, explicit, and backward-compatible way. Motivation and Context Currently, users who need to pass metadata (like progress tokens or user context) to tool calls have to work around the SDK's limitations by either: Creating custom session classes that override call_tool Passing metadata through the arguments parameter (which is not semantically correct) This change provides a proper, first-class way to pass request metadata while maintaining full backward compatibility. How Has This Been Tested? Added comprehensive unit tests for both ClientSession.call_tool and ClientSessionGroup.call_tool with _meta parameter Verified that existing functionality remains unchanged (backward compatibility) Tested that _meta data is properly passed through to the underlying request structure All existing tests continue to pass Breaking Changes No breaking changes. The _meta parameter is optional and defaults to None, so existing code will continue to work without modification. Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context The implementation leverages the existing RequestParams.Meta structure that was already defined in the types The _meta parameter is passed as the _meta field in CallToolRequestParams, which inherits from RequestParams This change is minimal and focused, affecting only the client-side tool calling interface The feature enables advanced use cases like progress tracking, user context passing, and other metadata requirements without requiring users to create custom session classes
Open Graph Description: Adds optional _meta parameter support to ClientSession.call_tool and ClientSessionGroup.call_tool methods, enabling users to pass request metadata (such as progress tokens or user context) in a cle...
X Description: Adds optional _meta parameter support to ClientSession.call_tool and ClientSessionGroup.call_tool methods, enabling users to pass request metadata (such as progress tokens or user context) in a cle...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/1003
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ab5a6f0c-1ddf-b4e3-775c-e2d6948d1766 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8FE4:90EFB:6D5175:9A80C4:6A5879EF |
| html-safe-nonce | 9ebead2f9fc1edb7f39c393e56e774946d2a73fbc9e6cccec098c41203c18c46 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkU0OjkwRUZCOjZENTE3NTo5QTgwQzQ6NkE1ODc5RUYiLCJ2aXNpdG9yX2lkIjoiNTE1MzEzNjgwNjE2MzE1MTM0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7733412289e0f8154b71e205e6f7aa8de6586dfcb909646b0e9f51508818bc89 |
| hovercard-subject-tag | pull_request:2609878542 |
| 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/1003/files |
| twitter:image | https://avatars.githubusercontent.com/u/52042038?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/52042038?s=400&v=4 |
| og:image:alt | Adds optional _meta parameter support to ClientSession.call_tool and ClientSessionGroup.call_tool methods, enabling users to pass request metadata (such as progress tokens or user context) in a cle... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| 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 | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width