Pass Metadata to MCP Tool Calls
The Agents SDK supports a tool_meta_resolver for local MCP integrations. This can inject request-scoped MCP _meta information such as trace context or tenant identifiers.
When metadata is appropriate
Use metadata for protocol/application context that should not be chosen by the model. If the model needs to reason about a value, it likely belongs in explicit tool arguments instead.
Do not trust client metadata blindly
Tenant or identity metadata must be validated against authenticated caller context. A client-supplied tenant ID should never grant access by itself.