Skip to content

Python: [Bug]: MCP tool spans mis-parented #5512

Description

@juliays

Description

_tools.py AIFounction.invoke() creates the execute_tool span via start_as_current_span. But the MCP SDK's httpx calls happen in a different anyio task that doesn't inherit that span context. Can it be updated to take the parent span as a parameter?

Code Sample

Error Messages / Stack Traces

Package Versions

1.2.0

Python Version

No response

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugUsage: [Issues], Target: all issues (Legacy, prefer issue type: bug)observabilityUsage: [Issues, PRs], Target: observability related featurespythonUsage: [Issues, PRs], Target: Python

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions