fix: use z.string() for attachment content to fix Gemini compatibility#14
Open
MaxwellCalkin wants to merge 1 commit intoagentmail-to:mainfrom
Open
fix: use z.string() for attachment content to fix Gemini compatibility#14MaxwellCalkin wants to merge 1 commit intoagentmail-to:mainfrom
MaxwellCalkin wants to merge 1 commit intoagentmail-to:mainfrom
Conversation
z.base64() produces a contentEncoding field in the JSON Schema output which Google Gemini's function calling API does not support, causing tool registration to fail for send_message, reply_to_message, and forward_message tools. Fixes agentmail-to/agentmail-mcp#8 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
z.base64()withz.string()for the attachmentcontentfield in the schemaz.base64()produces acontentEncoding: "base64"field in the JSON Schema output, which Google Gemini's function calling API does not supportsend_message,reply_to_message, andforward_messagetools when used with any Gemini modelThe description
'Base64 encoded content'is preserved so consumers still know to provide base64 data.Fixes agentmail-to/agentmail-mcp#8
Test plan
🤖 Generated with Claude Code
Summary by cubic
Switch the attachment content field from z.base64() to z.string() to avoid emitting contentEncoding in the JSON Schema, which Gemini’s function-calling API does not support. This unblocks MCP tool registration (send_message, reply_to_message, forward_message) with Gemini, while keeping the "Base64 encoded content" description so clients still send base64 strings.
Written for commit 342d8dc. Summary will update on new commits.