Skip to content

Capture MCP tool invocation response metadata #3323

@anirbanbasu

Description

@anirbanbasu

Description

The Model Context Protocol (MCP) supports attaching metadata by both clients and servers, see: https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta

Currently, the ToolResultPart in Pydantic AI has a metadata attribute but it does not capture the metadata sent by an MCP server as a result of a tool invocation. It would be a nice feature to have the metadata from the MCP tool call attached as a JSON string to the metadata attribute of ToolResultPart.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions