fastmcp/docs/servers
Bill Easton 7184a4ca21
OTEL: Fix attribute compliance with MCP semantic conventions (#3889)
* OTEL: Fix attribute compliance and improve telemetry helpers

Attribute compliance:
- Remove rpc.system/service/method (MCP is not traditional RPC)
- Add gen_ai.tool.name on tools/call spans
- Add gen_ai.prompt.name on prompts/get spans
- Fix session_id check (truthy -> is not None)

Telemetry helper improvements:
- Add is_recording() guards to skip work on non-recording spans
- Add error.type attribute with __qualname__ on error spans
- Use isinstance check for ToolError to set "tool_error" error type
- Include exception message in span status description
- Add tool_name/prompt_name params to server_span and client_span

Client call_tool enrichment:
- Reflect tool-level errors (result.isError) on client span status
  so callers see ERROR even though the MCP protocol call succeeded

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove resource URI from span names to avoid high-cardinality

Per MCP semantic conventions, resource URIs SHOULD NOT be included in
span names by default since they can be unbounded (especially with
templates like users://{id}/profile). The URI remains available via
the mcp.resource.uri attribute.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: add missing gen_ai/mcp attributes to proxy and delegate spans

- Proxy tool spans: add gen_ai.tool.name
- Proxy prompt spans: add gen_ai.prompt.name
- All delegate spans: add mcp.method.name
- Docs: remove rpc.* references, update span names and attributes table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Hoist ToolError imports to module level, add rpc.* migration note

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 16:28:47 -04:00
..
auth Allow auth providers to override protected resource base URLs (#3900) 2026-04-13 13:36:55 -04:00
providers Rename filesystem-provider example dir to avoid mcp/ collision (#3878) 2026-04-12 17:01:58 -04:00
transforms fix: route ResourcesAsTools/PromptsAsTools through server middleware (#3495) 2026-03-15 16:35:54 -04:00
authorization.mdx Support async auth checks (#3152) 2026-02-11 12:48:51 -05:00
composition.mdx Restructure docs navigation: CLI section, Composition, More (#3361) 2026-03-02 21:09:48 -05:00
context.mdx Document session state isolation across mount boundaries (#3801) 2026-04-09 16:15:57 -04:00
dependency-injection.mdx fix: HTTP request headers not accessible in background task workers (#3631) 2026-03-27 21:48:33 -04:00
elicitation.mdx Add response_title and response_description to ctx.elicit() (#3912) 2026-04-13 20:12:09 -04:00
icons.mdx Restructure documentation for FastMCP 3.0 (#2951) 2026-01-19 21:33:35 -05:00
lifespan.mdx Restructure documentation for FastMCP 3.0 (#2951) 2026-01-19 21:33:35 -05:00
logging.mdx Restructure documentation for FastMCP 3.0 (#2951) 2026-01-19 21:33:35 -05:00
middleware.mdx Document session state isolation across mount boundaries (#3801) 2026-04-09 16:15:57 -04:00
pagination.mdx Restructure documentation for FastMCP 3.0 (#2951) 2026-01-19 21:33:35 -05:00
progress.mdx Restructure documentation for FastMCP 3.0 (#2951) 2026-01-19 21:33:35 -05:00
prompts.mdx Extract parameter descriptions from docstrings (#3872) 2026-04-12 13:43:48 -04:00
resources.mdx Add encoding parameter to FileResource (#3580) 2026-03-22 09:55:16 -04:00
sampling.mdx Add concurrent tool execution with sequential flag (#3022) 2026-02-09 20:43:53 -05:00
server.mdx Support logging/setLevel and add client_log_level setting (#3491) 2026-03-14 10:36:01 -04:00
storage-backends.mdx Fix broken code examples in docs (#3869) 2026-04-12 12:53:04 -04:00
tasks.mdx Update docs for 3.0 GA release (#3216) 2026-02-18 14:29:28 -05:00
telemetry.mdx OTEL: Fix attribute compliance with MCP semantic conventions (#3889) 2026-04-14 16:28:47 -04:00
testing.mdx Restructure docs navigation: CLI section, Composition, More (#3361) 2026-03-02 21:09:48 -05:00
tools.mdx Extract parameter descriptions from docstrings (#3872) 2026-04-12 13:43:48 -04:00
versioning.mdx Add include_unversioned option to VersionFilter (#3349) 2026-03-02 21:06:50 -05:00
visibility.mdx Restructure documentation for FastMCP 3.0 (#2951) 2026-01-19 21:33:35 -05:00