feat(js/plugins/mcp): support for multipart tools#5205
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for multipart tool actions within the MCP (Model Context Protocol) plugin and enhances the Google GenAI plugin's handling of tool responses. Key changes include the addition of a multipart configuration flag for MCP clients and hosts, allowing tools to return structured content such as text and media parts. The toGeminiToolResponse converter in the Google GenAI plugin was updated to process these multipart responses, merging text content and handling media parts for compatibility with Gemini models. Additionally, the MCP SDK was upgraded, and new tests and a test application were added to verify the multipart functionality. I have no feedback to provide as no review comments were submitted.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for multipart tool actions across the Genkit ecosystem, specifically within the MCP and Google GenAI plugins. It upgrades the MCP SDK to version 1.29.0 and refactors the MCP client and host to support a multipart configuration, enabling the processing of rich content types like images and resources from MCP tools. Additionally, the Google GenAI plugin was updated to handle multipart tool responses. Review feedback identifies critical omissions of context and metadata pass-through in tool registration, potential API schema violations in the Gemini converter, and a discrepancy in the new multipart test cases.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for multipart tools in the MCP plugin, enabling tools to return media parts and resource links. It also updates the Google GenAI plugin to handle these new part types and improves error reporting. Feedback was provided to ensure that text output is preserved when an MCP tool returns both structured content and text.
Checklist (if applicable):