Skip to content

feat(js/plugins/mcp): support for multipart tools#5205

Merged
ifielker merged 5 commits intomainfrom
if-mcpv2Tools
May 7, 2026
Merged

feat(js/plugins/mcp): support for multipart tools#5205
ifielker merged 5 commits intomainfrom
if-mcpv2Tools

Conversation

@ifielker
Copy link
Copy Markdown
Collaborator

Checklist (if applicable):

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ifielker ifielker requested a review from pavelgj April 29, 2026 00:52
Comment thread js/plugins/google-genai/src/common/converters.ts
Comment thread js/plugins/google-genai/tests/common/converters_test.ts
@ifielker
Copy link
Copy Markdown
Collaborator Author

ifielker commented May 5, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread js/plugins/mcp/src/util/tools.ts Outdated
Comment thread js/plugins/mcp/src/util/tools.ts Outdated
Comment thread js/plugins/google-genai/src/common/converters.ts
Comment thread js/plugins/mcp/tests/host_test.ts Outdated
Comment thread js/plugins/mcp/src/util/tools.ts Outdated
@ifielker
Copy link
Copy Markdown
Collaborator Author

ifielker commented May 7, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread js/plugins/mcp/src/util/tools.ts
Comment thread js/plugins/mcp/src/client/host.ts Outdated
@ifielker ifielker merged commit b7e97e9 into main May 7, 2026
8 checks passed
@ifielker ifielker deleted the if-mcpv2Tools branch May 7, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants