[BUG] MCPAgentTool.stream() drops _meta on every model-driven tool call
Checks
- I have updated to the lastest minor and patch version of Strands
- I have checked the documentation and this is not expected behavior
- I have searched ./issues and there are no duplicates of my issue
SDK Language
Python
Strands Version
1.50.1, 1.42.0
Language Runtime Version
Python 3.13.5
Operating System
MacOS/26.5.2, AWS Lambda/Amazon Linux 2023
Installation Method
other
Steps to Reproduce
- Register an
MCPClientas a tool with a StrandsAgent. - Let the model invoke that tool naturally (not via a direct
call_tool_sync/call_tool_asynccall). - Inspect the outgoing JSON-RPC
tools/callrequest on the MCP server side.
Expected: a way to have request-scoped _meta attached to the call.
Actual: _meta is always absent — MCPAgentTool.stream() has no
mechanism to supply it, and ToolUse/invocation_state carry no meta field
that could be threaded through.
Expected Behavior
Request-scoped _meta is attached to all MCP calls.
Actual Behavior
MCPClient.call_tool_sync / call_tool_async both accept a meta: dict | None
kwarg that is forwarded as the MCP request's standard _meta field
(mcp_client.py:591-693). However, the only code path that runs when the
model decides to call an MCP tool — MCPAgentTool.stream() — never passes
it:
# strands/tools/mcp/mcp_agent_tool.py:113-117
result = await self.mcp_client.call_tool_async(
tool_use_id=tool_use["toolUseId"],
name=self.mcp_tool.name,
arguments=tool_use["input"],
read_timeout_seconds=self.timeout,
)Because meta isn't in that call, it silently defaults to None for every
tool invocation the agent's own tool-use loop makes. There is no supported way
to get request-scoped _meta (e.g. a conversation id, trace id, or other
per-request context) onto a model-driven MCP tool call — meta is only
reachable if application code bypasses the framework and calls
call_tool_sync/call_tool_async directly, which isn't an option when tool
calls are dispatched by the Strands Agent loop.
Additional Context
No response
Possible Solution
Let MCPClient/MCPAgentTool accept a bindable default meta (e.g. at construction time) that stream() falls back to when no per-call meta is present, so applications don't need to subclass MCPClient just to inject request-scoped context.
Related Issues
No response
Source: strands-agents/harness-sdk