claude-code - 💡(How to fix) Fix [BUG] Gmail MCP: create_draft produces phantom drafts on threads — likely missing In-Reply-To/References headers [1 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#48017Fetched 2026-04-15 06:35:44
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Error Message

Error Messages/Logs

No error is returned. The create_draft call succeeds and returns a valid draft ID. The problem is only visible in the Gmail web UI where phantom "Draft" labels appear on the thread but the drafts themselves are inaccessible.

Fix Action

Fix / Workaround

Workaround: Phantom drafts can be deleted via the Gmail API drafts.delete endpoint using draft IDs obtained from drafts.list.
This requires OAuth credentials and API access that most users won't have. No workaround exists within the Gmail web UI.

Code Example

No error is returned. The create_draft call succeeds and returns a valid draft ID. The problem is only visible in the Gmail web UI where phantom "Draft" labels appear on the thread but the drafts themselves are inaccessible.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When Claude uses gmail_create_draft with a threadId to create a reply draft on an existing thread, and the draft is later revised (creating a second or third draft on the same thread), the older drafts become "phantom" entries in the Gmail web UI.

Symptoms:

  • The Gmail thread list shows multiple "Draft" labels (e.g., "Draft, Draft, Draft") on the affected thread
  • Clicking into the thread only shows the most recent draft
  • The older drafts are not visible as editable compose windows inside the thread
  • They do not appear as individual items in the Drafts folder
  • There is no way to select or delete them in the Gmail web UI
  • The Gmail API drafts.list endpoint does return these phantom draft IDs, and drafts.delete can remove them — but most users don't have API access

Likely cause: The Gmail API requires In-Reply-To and References headers when creating a threaded draft reply. Without these, drafts "float" invisibly in the thread history. The MCP tool documentation states these are "automatically set from the last message in the thread," but the phantom behavior suggests they may be missing or malformed.

Additionally, when a user asks Claude to revise a draft, the MCP creates a new drafts.create call instead of updating the existing draft via drafts.update. This produces duplicate drafts on the same thread that accumulate as phantom entries.

What Should Happen?

  1. Drafts created with threadId should include valid In-Reply-To and References headers per RFC 822, so they anchor correctly in the Gmail UI
  2. When revising an existing draft on the same thread, the MCP should use drafts.update instead of drafts.create to replace the draft in place rather than creating duplicates
  3. Alternatively, expose a gmail_delete_draft tool so users can clean up phantom drafts without needing direct API access

Error Messages/Logs

No error is returned. The create_draft call succeeds and returns a valid draft ID. The problem is only visible in the Gmail web UI where phantom "Draft" labels appear on the thread but the drafts themselves are inaccessible.

Steps to Reproduce

  1. Ask Claude to draft a reply to an existing Gmail thread
  2. Claude calls gmail_create_draft with threadId — draft appears correctly
  3. Ask Claude to revise the draft (e.g., "add a paragraph about X")
  4. Claude calls gmail_create_draft again with the same threadId — a second draft is created
  5. In Gmail web UI, the thread now shows "Draft, Draft" in the thread list
  6. Click into the thread — only the newest draft is visible
  7. The older draft cannot be found, opened, or deleted anywhere in the Gmail UI
  8. Repeat steps 3-4 to produce additional phantom drafts

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

 2.1.85

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Related issue: #45775 reports that the newer MCP tool schema dropped the threadId parameter entirely. This issue describes the behavior when threadId is present but the resulting drafts don't anchor properly in the Gmail UI.

Affected threads: Multiple threads across different contacts over several weeks. Not a one-time occurrence.

Workaround: Phantom drafts can be deleted via the Gmail API drafts.delete endpoint using draft IDs obtained from drafts.list.
This requires OAuth credentials and API access that most users won't have. No workaround exists within the Gmail web UI.

extent analysis

TL;DR

The issue can be resolved by ensuring that the In-Reply-To and References headers are correctly set when creating a threaded draft reply using the Gmail API, and by using the drafts.update method instead of drafts.create when revising an existing draft.

Guidance

  • Verify that the In-Reply-To and References headers are being set correctly in the gmail_create_draft call by checking the API request payload.
  • Update the code to use the drafts.update method when revising an existing draft, instead of creating a new draft with drafts.create.
  • Consider exposing a gmail_delete_draft tool to allow users to clean up phantom drafts without needing direct API access.
  • Review the related issue #45775 to ensure that the threadId parameter is being handled correctly in the newer MCP tool schema.

Example

No code example is provided as the issue does not include specific code snippets, but the drafts.update method should be used instead of drafts.create when revising an existing draft.

Notes

The issue is not specific to a particular version of the Claude Code, and the problem is reproducible across multiple threads and contacts. The workaround using the Gmail API drafts.delete endpoint requires OAuth credentials and API access, which most users do not have.

Recommendation

Apply a workaround by using the drafts.update method when revising an existing draft, and consider exposing a gmail_delete_draft tool to allow users to clean up phantom drafts. This is because the root cause of the issue is the incorrect handling of draft revisions, and using drafts.update should resolve 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: create_draft produces phantom drafts on threads — likely missing In-Reply-To/References headers [1 participants]