Search documentation

Search guides, connectors and tools

Google Gmail

Gmail account connector to manage emails and drafts.

google-gmailOAuth12 tools1 trigger

Tools

Ask an agent for what you need in plain language — it picks the right tool itself. You can also limit which of these an agent may use, and require your approval before any of them runs.

Create Draft

createDraft€0.01 per call

Create a draft email.

ParameterTypeDescription
torequiredstring
subjectrequiredstring
bodyrequiredstring

Change Labels

changeLabels€0.01 per call

Add or remove labels on a message.

ParameterTypeDescription
messageIdrequiredstring
addLabelIdsstring[]
removeLabelIdsstring[]

Add Attachment to Draft

addAttachmentToDraft€0.01 per call

Add a file attachment from agent storage to an existing Gmail draft.

ParameterTypeDescription
draftIdrequiredstring
filePathrequiredstringAbsolute path to the file in agent storage (e.g. "/chats/<chatId>/generated/call_abc123.png"). Use the exact path reported by the imageGeneration tool result.
filenamestringOverride the attachment filename shown to the recipient

Search Emails

searchEmails€0.01 per call

Search Gmail messages using Gmail search syntax and return matching message summaries.

ParameterTypeDescription
queryrequiredstringGmail search query using Gmail search syntax (e.g. "from:alice@example.com is:unread subject:invoice").
labelIdsstring[]Restrict results to messages carrying all of these label IDs.
maxResultsintegerMaximum number of messages to return (capped at 25).
pageTokenstringPage token returned by a previous search to fetch the next page.

Get Email

getEmail€0.01 per call

Fetch the full content of a Gmail message including headers, body, and attachment list.

ParameterTypeDescription
messageIdrequiredstringGoogle Gmail message ID (as returned by searchEmails or an email trigger).

Get Thread

getThread€0.01 per call

Fetch all messages in a Gmail conversation thread with their headers and bodies.

ParameterTypeDescription
threadIdrequiredstringGoogle Gmail thread ID (as returned by searchEmails, getEmail, or an email trigger).

List Labels

listLabels€0.01 per call

List all Gmail labels with their IDs and names (needed to add or remove labels).

ParameterTypeDescription
_unusedbooleanIgnore; call with {} or omit this field.

Save Attachment

saveAttachment€0.01 per call

Download an attachment from a Gmail message and store it in agent file storage.

ParameterTypeDescription
messageIdrequiredstringGoogle Gmail message ID that contains the attachment.
attachmentIdrequiredstringAttachment ID from the message (as reported by the getEmail tool).
filenamerequiredstringFilename to store the attachment under in agent storage.
targetDirectorystringOptional directory in agent storage to save into (e.g. "/attachments"). Defaults to "/attachments".

Send Email

sendEmail€0.01 per call

Send an email immediately, optionally as a reply within an existing thread.

ParameterTypeDescription
torequiredstringRecipient address(es), comma-separated.
subjectrequiredstring
bodyrequiredstring
ccstringCC address(es), comma-separated.
bccstringBCC address(es), comma-separated.
threadIdstringGoogle Gmail thread ID to attach this message to (for replies).
inReplyToMessageIdstringRFC Message-ID header value of the email being replied to (e.g. "<abc@mail.example.com>"). Sets In-Reply-To and References so the reply threads correctly.

Send Draft

sendDraft€0.01 per call

Send an existing Gmail draft.

ParameterTypeDescription
draftIdrequiredstringGoogle Gmail draft ID to send (as returned by createDraft).

Trash Message

trashMessage€0.01 per call

Move a Gmail message to the Trash. The message is recoverable, not permanently deleted.

ParameterTypeDescription
messageIdrequiredstringGoogle Gmail message ID to move to Trash (recoverable).

Create Label

createLabel€0.01 per call

Create a new Gmail label.

ParameterTypeDescription
namerequiredstringLabel name. Use "/" to create nested labels (e.g. "Clients/Acme").

Triggers

Triggers start an agent automatically when something happens in the connected account. See triggers and schedules.

Receive Email

googleGmailReceiveEmail

Triggers when a new email is received.

Filters

ParameterTypeDescription
senderPatternstring
subjectPatternstring
bodyContainsstring
hasAttachmentboolean

Permissions

You choose what to grant on the provider's consent screen. A tool is only available to your agents if you granted the permission it needs, so granting less simply means fewer tools.

  • https://www.googleapis.com/auth/gmail.compose
  • https://www.googleapis.com/auth/gmail.modify