Skip to content

Commit d385735

Browse files
CopilotCopilot
andcommitted
docs: broaden MCP _meta scope note to cover all provider-managed transports (microsoft#5547)
- List OpenAIChatClient.get_mcp_tool() and AnthropicClient.get_mcp_tool() alongside FoundryChatClient.get_mcp_tool() as hosted/provider-managed exceptions; restricting the carve-out to Foundry was misleading for readers using other providers - Fix get_toolbox() wording: use 'await client.get_toolbox(...)' and note that toolbox.tools is passed into Agent(tools=...) so it reads as an async instance method call, not a static/class method call - Add parenthetical '(or any other client-opened MCPTool subclass)' to future-proof the list of covered transports Co-authored-by: Copilot <[email protected]>
1 parent b6c6841 commit d385735

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • python/samples/02-agents/observability

‎python/samples/02-agents/observability/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Next to what happens in the code when you run, we also make setting up observabi
2626

2727
Whenever there is an active OpenTelemetry span context, Agent Framework automatically propagates trace context to MCP servers via the `params._meta` field of `tools/call` requests. It uses the globally-configured OpenTelemetry propagator(s) (W3C Trace Context by default, producing `traceparent` and `tracestate`), so custom propagators (B3, Jaeger, etc.) are also supported. This enables distributed tracing across agent-to-MCP-server boundaries, compliant with the [MCP `_meta` specification](https://modelcontextprotocol.io/specification/2025-11-25/basic#_meta).
2828

29-
**Scope:** automatic `_meta` injection applies to MCP sessions that the agent process itself opens — `MCPStreamableHTTPTool`, `MCPStdioTool`, and `MCPWebsocketTool`. For **hosted MCP tools** (`FoundryChatClient.get_mcp_tool(...)`) and **toolbox-fetched tools** (`FoundryChatClient.get_toolbox(...)`), the `tools/call` message is issued by the Foundry agent service runtime rather than by the agent process. As a result, the framework has no opportunity to inject trace context into those requests, and propagating `traceparent`/`tracestate` across the agent–toolbox–MCP boundary is the responsibility of the Foundry service runtime, not of Agent Framework. If end-to-end distributed tracing to the downstream MCP server is required, use `MCPStreamableHTTPTool` (or another client-opened transport) instead of a toolbox connector.
29+
**Scope:** automatic `_meta` injection applies only to MCP sessions that the agent process itself opens — `MCPStreamableHTTPTool`, `MCPStdioTool`, and `MCPWebsocketTool` (or any other client-opened `MCPTool` subclass). It does **not** apply to hosted/provider-managed MCP tool configurations such as `FoundryChatClient.get_mcp_tool(...)`, `OpenAIChatClient.get_mcp_tool(...)`, `AnthropicClient.get_mcp_tool(...)`, or toolbox-fetched tools (for example, `toolbox = await client.get_toolbox(...)`, then passing `toolbox.tools` into `Agent(tools=...)`), because in those cases the `tools/call` message is issued by the provider service runtime rather than by the agent process. As a result, the framework has no opportunity to inject trace context into those requests, and propagating `traceparent`/`tracestate` across that hosted-service boundary is the responsibility of the service runtime, not Agent Framework. If end-to-end distributed tracing to the downstream MCP server is required, use a client-opened MCP transport instead of a hosted connector.
3030

3131
### Five patterns for configuring observability
3232

0 commit comments

Comments
 (0)