-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Feature requestNew feature requestNew feature request
Description
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
- Model Context Protocol (June 18, 2025 standard) support for metadata: https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta
- Support for metadata in FastMCP (Python): https://gofastmcp.com/servers/tools#toolresult-and-metadata. FastMCP also supports the MCP standard metadata https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta in its content blocks.
- Following from and related to the conversation: Feature request: Pass metadata to MCP server tool calls #1872 (comment)
- Example MCP server that attaches response metadata to
TextContentblocks: Frankfurter MCP. Try remotely hosted options for testing at Smithery or FastMCP cloud.
Metadata
Metadata
Assignees
Labels
Feature requestNew feature requestNew feature request