Skip to content

fix: coerce page/pageSize params to number in list_emails and search_emails#28

Open
harcek wants to merge 1 commit into
codefuturist:mainfrom
harcek:fix/coerce-params
Open

fix: coerce page/pageSize params to number in list_emails and search_emails#28
harcek wants to merge 1 commit into
codefuturist:mainfrom
harcek:fix/coerce-params

Conversation

@harcek

@harcek harcek commented Apr 26, 2026

Copy link
Copy Markdown

MCP callers send all parameters as strings. z.number() rejects string "20" with a type error; z.coerce.number() accepts it. Without this fix, pagination breaks for any caller that doesn't pre-cast the value.

Tested against Gmail and other IMAP providers.

…emails

MCP callers may pass page/pageSize as strings. z.coerce.number() handles
both string and number inputs, preventing validation errors at runtime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant