claude-code - 💡(How to fix) Fix [BUG] Gmail MCP: gmail_read_message fails on all draft messages (returns error, no body) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48689Fetched 2026-04-16 06:53:41
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

gmail_read_message returns an error for ALL draft messages. It works correctly on sent/inbox messages but fails on every draft — including drafts just created by gmail_create_draft in the same session. 2. Immediately read it: gmail_read_message(messageId)error | gmail_read_message on ANY draft | ❌ Broken — returns opaque error |

Root Cause

Root Cause Hypothesis

RAW_BUFFERClick to expand / collapse

Bug Description

gmail_read_message returns an error for ALL draft messages. It works correctly on sent/inbox messages but fails on every draft — including drafts just created by gmail_create_draft in the same session.

Reproduction Steps

  1. Create a draft: gmail_create_draft → returns messageId
  2. Immediately read it: gmail_read_message(messageId)error
  3. Read any sent message with gmail_read_messageworks fine

What Works vs What's Broken

ToolStatus
gmail_search_messages (finds drafts)✅ Works (snippet only)
gmail_list_drafts✅ Works (snippet only)
gmail_create_draft✅ Works
gmail_read_message on sent/inbox✅ Works
gmail_read_message on ANY draft❌ Broken — returns opaque error
gmail_get_profile✅ Works

Impact

This breaks any workflow that uses Gmail drafts as a communication channel. We use drafts as a dead-drop protocol between Claude Code instances — the primary comms system for our multi-agent setup. With this broken, agents can find drafts exist (via search/list) but cannot read the body content.

Environment

  • Claude Code version: 2.1.107 (updated 2026-04-14)
  • Platform: Windows 11, bash shell
  • Gmail MCP: Anthropic-hosted remote server (claude_ai_Gmail)
  • This worked in previous sessions (pre-2.1.107 and/or pre-April 14 MCP server state)

Root Cause Hypothesis

Gmail API requires drafts.get(draftId) to read draft bodies — messages.get(messageId) does not return bodies for draft-only messages. The MCP server likely uses messages.get() internally, which works for sent/inbox but not drafts.

Related

  • #32266 — gmail_send_draft tool also missing from hosted server

Requested Fix

Either:

  1. Fix gmail_read_message to handle draft messageIds (use drafts.get internally when the message has DRAFT label), or
  2. Add a dedicated gmail_read_draft(draftId) tool

🤖 Generated with Claude Code

extent analysis

TL;DR

The gmail_read_message function likely needs to be modified to use drafts.get(draftId) instead of messages.get(messageId) when handling draft messages.

Guidance

  • Verify that the gmail_read_message function is indeed using messages.get(messageId) internally by checking the function's implementation or documentation.
  • Check if the drafts.get(draftId) method is available in the Gmail API and if it requires any specific permissions or setup.
  • Consider adding a conditional statement to the gmail_read_message function to use drafts.get(draftId) when the message has a DRAFT label.
  • Test the modified function with a draft message to ensure it returns the correct body content.

Example

def gmail_read_message(messageId):
    # Check if the message is a draft
    if has_draft_label(messageId):
        # Use drafts.get(draftId) to read the draft body
        return drafts.get(draftId).execute()
    else:
        # Use messages.get(messageId) for non-draft messages
        return messages.get(messageId).execute()

Notes

The provided code snippet is a hypothetical example and may not match the actual implementation of the gmail_read_message function. The has_draft_label function is also assumed to exist and is not implemented in this example.

Recommendation

Apply a workaround by modifying the gmail_read_message function to use drafts.get(draftId) when handling draft messages, as this is the most direct solution to the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Gmail MCP: gmail_read_message fails on all draft messages (returns error, no body) [1 comments, 2 participants]