Expand description
The Gmail tool’s write actions (G3), named after Google’s Gmail MCP tools
(SPEC_GOOGLE_CONNECTORS_GMAIL_CALENDAR_DRIVE_2026_10_14.md §5, §6):
create_draft, update_draft, label_thread (no prompt with a write grant),
send_draft and trash_thread (always ask the person).
There is no raw send: an agent writes a draft, and sending is send_draft, which shows the
person the draft exactly as it will go. This module is the pure half, as super::gmail is for
reads: the mail an agent describes as a message Google takes (outgoing, rfc822), the
requests, what the person is shown (DraftView, send_question) and the check that what
they approved is what is sent (DraftView::digest). The flow that asks and calls is
super::gmail_flow.
Structs§
- Draft
View - A draft as it is stored: what
send_draftshows the person and checks again before sending. - Outgoing
- One mail as an agent describes it, checked.
- Reply
- What a reply needs from the thread it answers.
Constants§
- WRITE_
ACTIONS - The write actions, in the order the tool lists them.
Functions§
- always_
asks - Actions that always wait for the person (§6).
- draft_
fetch_ plan - The request for a draft as it is now, to show the person and to check before sending.
- draft_
plan - The request for
create_draft(or, with a draft id,update_draft). Athread_idmakes the draft a reply in that thread:replyis that thread’s last message (seereply_of), which a reply needs for Gmail to thread it. - draft_
raw_ plan - The request for the draft’s message as raw MIME: the snapshot that is sent.
- granted_
for - Whether
granted(full scope URLs, or bare names) covers the writeaction. - label_
plan - The request for
label_thread. Putting a thread in the trash takestrash_thread, which asks the person, so the trash label is not one this can add. - needs
- The scopes an action can run with: any one is enough. A draft or a send is
gmail.compose; labels and trash needgmail.modify(which includes compose). - outgoing
- The mail
argsdescribes. A draft needs a recipient only in the end:create_draftmay leavetoempty for the person to fill in, but nothing is sent without one. - reply_
fetch_ plan - The request for the headers of the thread a draft replies to.
- reply_
of - The reply headers for an answer to the last message of
thread(Google’sthreads.get, format metadata);Nonewhen it has no usableMessage-ID. - rfc822
- The mail as RFC 5322 text, which Gmail takes (base64url) as a draft’s
raw. NoFrom: Gmail writes the account’s own address. - send_
plan - The request that sends the draft
idwith exactly the messageraw(base64url MIME) that was checked, so a save made after the check cannot put other text, recipients or files in its place. - send_
question - The title and text of the window that asks the person to send
view. - send_
question_ in send_questionfor a draft that replies into a thread: the warning first, the thread after the recipients.- trash_
plan - The request that moves a thread to the trash (it stays there for 30 days).
- trash_
question - The title and text of the window that asks the person to trash a thread.
summaryis the thread’s headers assuper::gmail::summary_planasks for them. - with_
reply oas a reply: its threading headers, and the original subject (withRe:) when it has none.