feat(client): add _meta support to call_tool for tool calls\n\n- Adds… #1003
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds optional
_meta
parameter support toClientSession.call_tool
andClientSessionGroup.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:
call_tool
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?
ClientSession.call_tool
andClientSessionGroup.call_tool
with_meta
parameter_meta
data is properly passed through to the underlying request structureBreaking Changes
No breaking changes. The
_meta
parameter is optional and defaults toNone
, so existing code will continue to work without modification.Types of changes
Checklist
Additional context
RequestParams.Meta
structure that was already defined in the types_meta
parameter is passed as the_meta
field inCallToolRequestParams
, which inherits fromRequestParams