Gmail MCP: gmail_search_messages ignores query parameter, returns latest messages regardless
Bug Description
gmail_search_messages ignores the query parameter entirely and always returns the same latest messages in reverse chronological order, regardless of the search query.
Environment
- Claude Code CLI (claude-code)
- Gmail MCP integration via claude.ai managed connection (
mcp__claude_ai_Gmail__) - Google Workspace account (custom domain)
- Account has ~1.38M messages
Reproduction
- Connect Gmail via
/mcp→ Reconnect Gmail - Confirm connection works:
gmail_get_profilereturns correct email ✅ - Run any search:
gmail_search_messages({ query: "subject:16633 Multileg" })
gmail_search_messages({ query: "is:starred" })
gmail_search_messages({ query: "from:openapisupport@saxobank.com" })
gmail_search_messages({ query: "in:sent to:openapisupport" })
All four queries return the exact same 5 results — the latest messages in the mailbox (promotional emails, unrelated newsletters). None match the search criteria.
Evidence
resultSizeEstimateis always201regardless of query- Results never include
STARREDlabel even when searchingis:starred nextPageTokenvaries slightly between calls, suggesting the API is being called, but without theqparameter- The query string appears to be dropped before reaching the Gmail API's
users.messages.listendpoint
What works
| Tool | Status |
|------|--------|
| gmail_get_profile | ✅ Works |
| gmail_list_labels | ✅ Works |
| gmail_list_drafts | ✅ Works |
| gmail_create_draft | ✅ Works |
| gmail_read_message | ✅ Works (with valid API message ID) |
| gmail_search_messages | ❌ Query ignored |
What doesn't work
gmail_search_messages— thequeryparameter has no effect on resultsgmail_read_threadwith web URL thread ID format (FMfcg...) — returns error (expected, different ID format)
Impact
Cannot programmatically find specific email threads, which blocks:
- Creating draft replies threaded to existing conversations
- Searching for specific messages by sender, subject, date, or label
- Any workflow that depends on email search
Attempted fixes
/mcp→ Reconnect Gmail: did not fix- Tried multiple query syntaxes (Gmail search operators, quoted strings, label filters): all ignored
Expected behavior
gmail_search_messages({ query: "subject:16633" }) should return only messages whose subject contains "16633", not the latest messages in the mailbox.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗