Skip to content

Gmail — Email ​

Get profile — gmail.get_profile ​

Gets the Gmail profile for the connected account, including emailAddress and mailbox totals. Use this to confirm which mailbox is linked before reading or sending mail.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyeshttps://www.googleapis.com/auth/gmail.readonly

Input

No input.

Extra fields: ignored.

Output

FieldTypeDescription
emailAddressstring
messagesTotalinteger
threadsTotalinteger
historyIdstring

List labels — gmail.list_labels ​

Lists Gmail labels for the connected account (id, name, type, visibility). Call this before modify_message_labels or create_label to resolve label ids. System labels like INBOX and UNREAD are included.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyeshttps://www.googleapis.com/auth/gmail.readonly

Input

No input.

Extra fields: ignored.

Output

FieldTypeDescription
labelsarray of object
labels[].idstring
labels[].namestring
labels[].typestring
labels[].messageListVisibilitystring
labels[].labelListVisibilitystring

Fetch emails — gmail.fetch_emails ​

Fetches a list of Gmail messages for the connected account. Supports Gmail search q, max_results, page_token, and label_ids. Use this to find candidates; call get_message or get_thread for full content.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyeshttps://www.googleapis.com/auth/gmail.readonly

Input

FieldTypeRequiredDescription
qstringnoGmail search query, same syntax as the Gmail search box, e.g. "from:anna is:unread".
max_resultsintegernoMax messages to return (1-500). Defaults to 100.
page_tokenstringnoToken for the next page. From nextPageToken of the previous gmail.fetch_emails call.
label_idsarray of stringnoOnly return messages that have all of these label ids, e.g. ["INBOX", "UNREAD"]. From gmail.list_labels.

Extra fields: sent as query parameters.

Output

FieldTypeDescription
messagesarray of objectList entries contain only id + threadId; use get_message for full content.
messages[].idstring
messages[].threadIdstring
nextPageTokenstring
resultSizeEstimateinteger

Get message — gmail.get_message ​

Fetches a single Gmail message by message_id. Prefer get_thread when the agent needs the full conversation context. Obtain ids via fetch_emails or list_threads.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyeshttps://www.googleapis.com/auth/gmail.readonly

Input

FieldTypeRequiredDescription
message_idstringyesId of the message to fetch. From gmail.fetch_emails or gmail.get_thread.
formatstringnoHow much of the message to return; raw gives the base64url MIME in raw. Defaults to full. One of: minimal, full, raw, metadata.

Extra fields: sent as query parameters.

Output

FieldTypeDescription
idstring
threadIdstring
labelIdsarray of string
snippetstring
historyIdstring
internalDatestring
sizeEstimateinteger
payloadobject
rawstring

Get thread — gmail.get_thread ​

Fetches a Gmail thread by thread_id, including messages in that conversation. Prefer this over get_message when the agent needs full reply context. Use list_threads or fetch_emails first if the id is unknown.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyeshttps://www.googleapis.com/auth/gmail.readonly

Input

FieldTypeRequiredDescription
thread_idstringyesId of the thread to fetch. From gmail.list_threads or gmail.fetch_emails (threadId).
formatstringnoHow much of each message to return. Defaults to full. One of: full, metadata, minimal.

Extra fields: sent as query parameters.

Output

FieldTypeDescription
idstring
snippetstring
historyIdstring
messagesarray of object
messages[].idstring
messages[].threadIdstring
messages[].labelIdsarray of string
messages[].snippetstring

List threads — gmail.list_threads ​

Lists Gmail conversation threads for the connected account. Supports Gmail search q, max_results, page_token, and label_ids. Listed threads omit messages — call get_thread for full conversation content.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyeshttps://www.googleapis.com/auth/gmail.readonly

Input

FieldTypeRequiredDescription
qstringnoGmail search query, same syntax as the Gmail search box, e.g. "from:anna is:unread".
max_resultsintegernoMax threads to return (1-500). Defaults to 100.
page_tokenstringnoToken for the next page. From nextPageToken of the previous gmail.list_threads call.
label_idsarray of stringnoOnly return threads that have all of these label ids, e.g. ["INBOX", "UNREAD"]. From gmail.list_labels.

Extra fields: sent as query parameters.

Output

FieldTypeDescription
threadsarray of objectList entries omit messages; use get_thread for full content.
threads[].idstring
threads[].snippetstring
threads[].historyIdstring
nextPageTokenstring
resultSizeEstimateinteger

Get attachment — gmail.get_attachment ​

Downloads a Gmail message attachment by message_id and attachment_id. Obtain attachment_id from get_message payload parts. Returns base64url-encoded data and byte size.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyeshttps://www.googleapis.com/auth/gmail.readonly

Input

FieldTypeRequiredDescription
message_idstringyesId of the message that has the attachment. From gmail.fetch_emails or gmail.get_thread.
attachment_idstringyesId of the attachment. From gmail.get_message (payload.parts[].body.attachmentId).

Extra fields: ignored.

Output

FieldTypeDescription
attachmentIdstring
sizeinteger
datastring

List drafts — gmail.list_drafts ​

Lists Gmail drafts for the connected account. Supports optional q, max_results, and page_token. Listed drafts only include message id/threadId — call get_draft for content.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyeshttps://www.googleapis.com/auth/gmail.readonly

Input

FieldTypeRequiredDescription
qstringnoOnly return drafts matching this Gmail search query, e.g. "subject:invoice".
max_resultsintegernoMax drafts to return (1-500). Defaults to 100.
page_tokenstringnoToken for the next page. From nextPageToken of the previous gmail.list_drafts call.

Extra fields: sent as query parameters.

Output

FieldTypeDescription
draftsarray of object
drafts[].idstring
drafts[].messageobject
drafts[].message.idstring
drafts[].message.threadIdstring
nextPageTokenstring
resultSizeEstimateinteger

Get draft — gmail.get_draft ​

Fetches a single Gmail draft by draft_id, including its message payload. Use list_drafts to discover ids. Prefer get_draft before send_draft or update_draft so the agent reviews current content.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyeshttps://www.googleapis.com/auth/gmail.readonly

Input

FieldTypeRequiredDescription
draft_idstringyesId of the draft to fetch. From gmail.list_drafts.
formatstringnoHow much of the draft message to return. Defaults to full. One of: minimal, full, raw, metadata.

Extra fields: sent as query parameters.

Output

FieldTypeDescription
idstring
messageobject
message.idstring
message.threadIdstring
message.labelIdsarray of string
message.snippetstring

Create draft — gmail.create_draft ​

Creates a Gmail draft with to, subject, and body. Does not send mail — use send_draft after review, or send_email for immediate send. Optional thread_id attaches the draft to an existing conversation.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumnonohttps://www.googleapis.com/auth/gmail.compose

Input

FieldTypeRequiredDescription
tostringyesRecipient email address; separate several with commas, e.g. "anna@example.com, bob@example.com".
subjectstringyesEmail subject line.
bodystringyesEmail body as plain text (HTML tags are not rendered).
thread_idstringnoThread to put this in; Subject must match the thread's subject. From gmail.list_threads or gmail.fetch_emails (threadId).
ccstringnoCC email addresses, comma-separated.
bccstringnoBCC email addresses, comma-separated.

Extra fields: ignored.

Output

FieldTypeDescription
idstring
messageobject
message.idstring
message.threadIdstring
message.labelIdsarray of string
message.snippetstring

Approval card: shown as email (to → to, cc → cc, bcc → bcc, subject → subject, body → body).

Update draft — gmail.update_draft ​

Replaces an existing Gmail draft identified by draft_id with new to, subject, and body. Does not send mail. Call get_draft first if the agent needs the prior content.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumnonohttps://www.googleapis.com/auth/gmail.compose

Input

FieldTypeRequiredDescription
draft_idstringyesId of the draft to replace. From gmail.list_drafts.
tostringyesNew recipient email address; separate several with commas. Replaces the draft's recipients.
subjectstringyesNew subject line; replaces the draft's subject.
bodystringyesNew body as plain text; replaces the draft's whole body.
thread_idstringnoThread to put this in; Subject must match the thread's subject. From gmail.list_threads or gmail.fetch_emails (threadId).
ccstringnoNew CC email addresses, comma-separated. Leave empty to drop CC.
bccstringnoNew BCC email addresses, comma-separated. Leave empty to drop BCC.

Extra fields: ignored.

Output

FieldTypeDescription
idstring
messageobject
message.idstring
message.threadIdstring
message.labelIdsarray of string
message.snippetstring

Approval card: shown as email (to → to, cc → cc, bcc → bcc, subject → subject, body → body).

Send draft — gmail.send_draft ​

Sends an existing Gmail draft as-is by draft_id. This delivers email to recipients already on the draft — irreversible from the agent. Prefer create_draft + human review before send_draft.

Side effectRiskNeeds approvalIdempotentScopes
WRITEhighyesnohttps://www.googleapis.com/auth/gmail.send

Input

FieldTypeRequiredDescription
draft_idstringyesId of the draft to send. From gmail.list_drafts or gmail.create_draft.

Extra fields: ignored.

Output

FieldTypeDescription
idstring
threadIdstring
labelIdsarray of string

Send email — gmail.send_email ​

Sends a new Gmail message with to, subject, and body immediately. This delivers mail to recipients — irreversible from the agent. Prefer create_draft + send_draft when human review is needed first.

Side effectRiskNeeds approvalIdempotentScopes
WRITEhighyesnohttps://www.googleapis.com/auth/gmail.send

Input

FieldTypeRequiredDescription
tostringyesRecipient email address; separate several with commas, e.g. "anna@example.com, bob@example.com".
subjectstringyesEmail subject line.
bodystringyesEmail body as plain text (HTML tags are not rendered).
ccstringnoCC email addresses, comma-separated.
bccstringnoBCC email addresses, comma-separated.
thread_idstringnoThread to put this in; Subject must match the thread's subject. From gmail.list_threads or gmail.fetch_emails (threadId).

Extra fields: ignored.

Output

FieldTypeDescription
idstring
threadIdstring
labelIdsarray of string

Approval card: shown as email (to → to, cc → cc, bcc → bcc, subject → subject, body → body).

Reply to thread — gmail.reply_to_thread ​

Sends a reply into an existing Gmail thread by thread_id with to, subject, and body. This delivers mail — irreversible from the agent; prefer draft review when unsure.

Side effectRiskNeeds approvalIdempotentScopes
WRITEhighyesnohttps://www.googleapis.com/auth/gmail.send

Input

FieldTypeRequiredDescription
thread_idstringyesId of the thread to reply in. From gmail.list_threads or gmail.fetch_emails (threadId).
bodystringyesReply text as plain text (HTML tags are not rendered).
tostringyesWho gets the reply, usually the original sender; separate several with commas.
subjectstringyesReply subject; match the thread's subject, e.g. "Re: Order 123", so Gmail keeps it in the thread.
ccstringnoCC email addresses, comma-separated.
bccstringnoBCC email addresses, comma-separated.

Extra fields: ignored.

Output

FieldTypeDescription
idstring
threadIdstring
labelIdsarray of string

Approval card: shown as email (to → to, cc → cc, bcc → bcc, subject → subject, body → body).

Forward message — gmail.forward_message ​

Forwards an existing Gmail message identified by message_id to a new to recipient. Optional body adds forward commentary. This delivers mail — irreversible from the agent.

Side effectRiskNeeds approvalIdempotentScopes
WRITEhighyesnohttps://www.googleapis.com/auth/gmail.readonly, https://www.googleapis.com/auth/gmail.send

Input

FieldTypeRequiredDescription
message_idstringyesId of the message to forward. From gmail.fetch_emails or gmail.get_thread.
tostringyesRecipient email address; separate several with commas, e.g. "anna@example.com, bob@example.com".
bodystringnoOptional plain-text note shown above the forwarded message.
subjectstringnoSubject of the forward. Defaults to "Fwd: " plus the original subject.
ccstringnoCC email addresses, comma-separated.
bccstringnoBCC email addresses, comma-separated.

Extra fields: ignored.

Output

FieldTypeDescription
idstring
threadIdstring
labelIdsarray of string

Approval card: shown as email (to → to, cc → cc, bcc → bcc, subject → subject, body → body).

Modify message labels — gmail.modify_message_labels ​

Adds and/or removes Gmail labels on one message. Provide message_id and at least one of add_label_ids / remove_label_ids. Use list_labels to resolve custom label ids before calling.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumnoyeshttps://www.googleapis.com/auth/gmail.modify

Input

FieldTypeRequiredDescription
message_idstringyesId of the message to relabel. From gmail.fetch_emails or gmail.get_thread.
add_label_idsarray of stringnoLabel ids to add, e.g. ["STARRED"]. From gmail.list_labels.
remove_label_idsarray of stringnoLabel ids to remove, e.g. ["UNREAD"] marks it read. From gmail.list_labels.

Extra fields: ignored.

Output

FieldTypeDescription
idstring
threadIdstring
labelIdsarray of string

Modify thread labels — gmail.modify_thread_labels ​

Adds and/or removes Gmail labels on an entire thread (all messages). Provide thread_id and at least one of add_label_ids / remove_label_ids. Use list_labels to resolve custom label ids before calling.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumnoyeshttps://www.googleapis.com/auth/gmail.modify

Input

FieldTypeRequiredDescription
thread_idstringyesId of the thread to relabel. From gmail.list_threads or gmail.fetch_emails (threadId).
add_label_idsarray of stringnoLabel ids to add to every message in the thread, e.g. ["STARRED"]. From gmail.list_labels.
remove_label_idsarray of stringnoLabel ids to remove from every message, e.g. ["INBOX"] archives it. From gmail.list_labels.

Extra fields: ignored.

Output

FieldTypeDescription
idstring
snippetstring
historyIdstring
messagesarray of object
messages[].idstring
messages[].threadIdstring
messages[].labelIdsarray of string
messages[].snippetstring

Create label — gmail.create_label ​

Creates a user Gmail label with the given name. Optional visibility fields control inbox list presentation. Use list_labels afterward to confirm the new label id before applying it.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumnonohttps://www.googleapis.com/auth/gmail.modify

Input

FieldTypeRequiredDescription
namestringyesDisplay name of the new label, e.g. "Customers/VIP" (a slash nests it under "Customers").
message_list_visibilitystringnoWhether messages with this label are shown in the message list. One of: show, hide.
label_list_visibilitystringnoWhether the label is shown in the label list; labelShowIfUnread shows it only when it has unread mail. One of: labelShow, labelShowIfUnread, labelHide.

Extra fields: ignored.

Output

FieldTypeDescription
idstring
namestring
typestring
messageListVisibilitystring
labelListVisibilitystring
messagesTotalinteger
messagesUnreadinteger
threadsTotalinteger
threadsUnreadinteger
colorobject

Trash message — gmail.trash_message ​

Moves a Gmail message to Trash by message_id. User-visible and recoverable via untrash_message until permanently deleted. Prefer trash over permanent delete for reversible cleanup.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumnoyeshttps://www.googleapis.com/auth/gmail.modify

Input

FieldTypeRequiredDescription
message_idstringyesId of the message to move to Trash. From gmail.fetch_emails or gmail.get_thread.

Extra fields: ignored.

Output

FieldTypeDescription
idstring
threadIdstring
labelIdsarray of string

Trash thread — gmail.trash_thread ​

Moves an entire Gmail thread (all messages) to Trash by thread_id. User-visible and recoverable via untrash_thread. Use when the whole conversation should leave the inbox.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumnoyeshttps://www.googleapis.com/auth/gmail.modify

Input

FieldTypeRequiredDescription
thread_idstringyesId of the thread to move to Trash. From gmail.list_threads or gmail.fetch_emails (threadId).

Extra fields: ignored.

Output

FieldTypeDescription
idstring
snippetstring
historyIdstring
messagesarray of object
messages[].idstring
messages[].threadIdstring
messages[].labelIdsarray of string
messages[].snippetstring

Untrash message — gmail.untrash_message ​

Restores a Gmail message from Trash by message_id. Use after trash_message when the agent or user wants the message back. Low-risk write; does not permanently delete.

Side effectRiskNeeds approvalIdempotentScopes
WRITElownoyeshttps://www.googleapis.com/auth/gmail.modify

Input

FieldTypeRequiredDescription
message_idstringyesId of the trashed message to restore. From gmail.trash_message or gmail.fetch_emails with q "in:trash".

Extra fields: ignored.

Output

FieldTypeDescription
idstring
threadIdstring
labelIdsarray of string

Untrash thread — gmail.untrash_thread ​

Restores an entire Gmail thread from Trash by thread_id. Use after trash_thread to bring the conversation back. Low-risk write; does not permanently delete.

Side effectRiskNeeds approvalIdempotentScopes
WRITElownoyeshttps://www.googleapis.com/auth/gmail.modify

Input

FieldTypeRequiredDescription
thread_idstringyesId of the trashed thread to restore. From gmail.trash_thread or gmail.list_threads with q "in:trash".

Extra fields: ignored.

Output

FieldTypeDescription
idstring
snippetstring
historyIdstring
messagesarray of object
messages[].idstring
messages[].threadIdstring
messages[].labelIdsarray of string
messages[].snippetstring

Delete draft — gmail.delete_draft ​

Permanently deletes a Gmail draft by draft_id (not trash — irreversible). Prefer update_draft or leave drafts when unsure. Requires approval because the draft cannot be recovered.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesyeshttps://www.googleapis.com/auth/gmail.compose

Input

FieldTypeRequiredDescription
draft_idstringyesId of the draft to delete for good. From gmail.list_drafts.

Extra fields: ignored.

Output

Returns an empty object.