diff --git a/src/fastmcp/server/server.py b/src/fastmcp/server/server.py index b653711aa..2f00e2017 100644 --- a/src/fastmcp/server/server.py +++ b/src/fastmcp/server/server.py @@ -621,9 +621,7 @@ class FastMCP( ) # Core logic: list tools - with server_span( - "tools/list", "tools/list", self.name, "tool", "" - ): + with server_span("tools/list", "tools/list", self.name, "tool", ""): # Get all tools, apply session transforms, then filter enabled # and model-visible (app-only tools are hidden from the model). tools = list(await super().list_tools()) @@ -1028,9 +1026,7 @@ class FastMCP( ) # Core logic: list prompts - with server_span( - "prompts/list", "prompts/list", self.name, "prompt", "" - ): + with server_span("prompts/list", "prompts/list", self.name, "prompt", ""): # Get all prompts, apply session transforms, then filter enabled prompts = list(await super().list_prompts()) prompts = await apply_session_transforms(prompts) diff --git a/tests/client/telemetry/test_client_list_tracing.py b/tests/client/telemetry/test_client_list_tracing.py index 33f066f5f..45038bbad 100644 --- a/tests/client/telemetry/test_client_list_tracing.py +++ b/tests/client/telemetry/test_client_list_tracing.py @@ -70,8 +70,7 @@ class TestClientListToolsTracing: ( s for s in tools_list_spans - if s.attributes is not None - and "fastmcp.server.name" in s.attributes + if s.attributes is not None and "fastmcp.server.name" in s.attributes ), None, )