Skip to navigation

Gmail

Connect your AI agents to Gmail.

Authentication: OAuth. See Magic Link for the runtime auth flow, or Application credentials to bring your own OAuth app.

Sample use cases

  • Find every email from contacts at our top-10 accounts in the last 7 days that I haven’t replied to.
  • Draft a follow-up reply to the latest message from customer@acme.com thanking them for the call.
  • Search for emails containing invoice from this month and forward them to accounting@.

Embed an image in an email

Add the image to attachments with its filename, base64 content, is_inline: true, and a unique content_id such as logo.png. Put <img src='cid:logo.png'> in body_html for a send, threaded reply, or draft. In a forward, put the tag in comment_html and use a content ID distinct from the original message’s images.

When updating a draft, reuse an image’s content ID to update it. Clearing regular attachments preserves inline images.

Available Tools

get_attachment

Download an attachment from a message by attachment ID: raw base64url data, filename, MIME type, and size.

list_drafts

List draft messages, newest first, with pagination.

get_draft

Retrieve complete details of a specific draft by ID including message content, headers, recipients, and metadata.

create_draft

Create a draft with recipients, subject, and body.

update_draft

Edit an existing draft. Only the fields you supply change; everything else (recipients, subject, body, attachments, thread) is preserved.

delete_draft

Permanently delete a draft. Cannot be undone. Draft and content are permanently removed.

send_draft

Send an existing draft immediately. Draft is sent as email and automatically deleted from drafts.

list_labels

List all labels, both system and custom.

get_label

Retrieve detailed information about a specific label by ID including name, type, visibility, message counts, and colors.

create_label

Create a custom label. Nest it by putting slashes in the name, e.g. ‘Clients/Acme’ creates Acme under Clients.

update_label

Update an existing label’s properties including name, visibility, and colors.

delete_label

Permanently delete a custom label. Removes label from all messages. Cannot delete system labels. Cannot be undone.

list_messages

Search or list messages with Gmail query syntax (from:, subject:, is:unread, newer_than:, OR, -negation) and pagination.

get_message

Retrieve complete message details by ID including the raw MIME tree, all headers, base64-encoded body parts, attachments, and labels.

send_message

Send an email. Supports HTML, CC/BCC, threading, inline attachments, ONE staged file via file_reference + file_reference_filename (~18 MB max).

modify_message_labels

Add or remove labels from a message. Supports up to 100 label additions/removals per operation.

delete_message

Move a message to trash by adding the TRASH label.

batch_delete_messages

Move multiple messages to trash in one batch by adding the TRASH label to each.

batch_modify_messages

Modify labels on multiple messages in one batch.

list_threads

Search or list conversation threads with Gmail query syntax and pagination.

get_thread

Retrieve a complete conversation thread by ID including all messages in chronological order.

modify_thread_labels

Add or remove labels from every message in a thread at once.

delete_thread

Move every message in a thread to trash by adding the TRASH label.

create_forward_draft

Create a forward of an email as a draft without sending it.

forward_message

Forward an email to new recipients and send it immediately.

get_message_text

Read one email’s body as plain text, with From/To/Subject/Date, Message-ID, labels, and an attachment list.

get_profile

Get the authenticated mailbox’s own address plus its total message and thread counts.

list_send_as_addresses

List the addresses this mailbox can send mail as, including aliases and delegated addresses.

read_attachment_text

Read a message attachment as text; prefer over get_attachment to READ.

untrash_message

Restore a message from trash by removing the TRASH label.

untrash_thread

Restore an entire conversation from trash by removing the TRASH label from its messages.