From 48c196a343d12e734985df4447d8720e53e82b53 Mon Sep 17 00:00:00 2001 From: William Easton Date: Tue, 14 Apr 2026 11:55:52 -0500 Subject: [PATCH] Pass tool_name/prompt_name to client_span in proxy providers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensures proxied tool/prompt spans get gen_ai.tool.name and gen_ai.prompt.name attributes, matching direct call spans. 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.6 (1M context) --- src/fastmcp/server/providers/proxy.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/fastmcp/server/providers/proxy.py b/src/fastmcp/server/providers/proxy.py index b59024c70..2bb877c93 100644 --- a/src/fastmcp/server/providers/proxy.py +++ b/src/fastmcp/server/providers/proxy.py @@ -119,7 +119,10 @@ class ProxyTool(Tool): """Executes the tool by making a call through the client.""" backend_name = self._backend_name or self.name with client_span( - f"tools/call {backend_name}", "tools/call", backend_name + f"tools/call {backend_name}", + "tools/call", + backend_name, + tool_name=backend_name, ) as span: span.set_attribute("fastmcp.provider.type", "ProxyProvider") client = await self._get_client() @@ -450,7 +453,10 @@ class ProxyPrompt(Prompt): """Render the prompt by making a call through the client.""" backend_name = self._backend_name or self.name with client_span( - f"prompts/get {backend_name}", "prompts/get", backend_name + f"prompts/get {backend_name}", + "prompts/get", + backend_name, + prompt_name=backend_name, ) as span: span.set_attribute("fastmcp.provider.type", "ProxyProvider") client = await self._get_client()