Skip to content

feat(pydantic-ai): Add tool description to execute_tool spans#5596

Merged
ericapisani merged 27 commits intomasterfrom
ep/add-tool-description-to-pydantic-ai-spans
Mar 9, 2026
Merged

feat(pydantic-ai): Add tool description to execute_tool spans#5596
ericapisani merged 27 commits intomasterfrom
ep/add-tool-description-to-pydantic-ai-spans

Conversation

@ericapisani
Copy link
Copy Markdown
Member

@ericapisani ericapisani commented Mar 5, 2026

Add the tool's description to gen_ai.execute_tool spans via the gen_ai.tool.description span data attribute.

When a pydantic-ai tool is defined with a docstring, that docstring becomes the tool's description in its ToolDefinition. This PR surfaces that description in the corresponding Sentry span, making it easier to understand what each tool does when inspecting traces.

The description is sourced from tool.tool_def.description on the internal tool object. If no description is available (e.g. the tool has no docstring), the attribute value is None.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants