Google Gmail
Gmail account connector to manage emails and drafts.
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 a draft email.
| Parameter | Type | Description |
|---|---|---|
| torequired | string | — |
| subjectrequired | string | — |
| bodyrequired | string | — |
Add or remove labels on a message.
| Parameter | Type | Description |
|---|---|---|
| messageIdrequired | string | — |
| addLabelIds | string[] | — |
| removeLabelIds | string[] | — |
Add a file attachment from agent storage to an existing Gmail draft.
| Parameter | Type | Description |
|---|---|---|
| draftIdrequired | string | — |
| filePathrequired | string | Absolute 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. |
| filename | string | Override the attachment filename shown to the recipient |
Search Gmail messages using Gmail search syntax and return matching message summaries.
| Parameter | Type | Description |
|---|---|---|
| queryrequired | string | Gmail search query using Gmail search syntax (e.g. "from:alice@example.com is:unread subject:invoice"). |
| labelIds | string[] | Restrict results to messages carrying all of these label IDs. |
| maxResults | integer | Maximum number of messages to return (capped at 25). |
| pageToken | string | Page token returned by a previous search to fetch the next page. |
Fetch the full content of a Gmail message including headers, body, and attachment list.
| Parameter | Type | Description |
|---|---|---|
| messageIdrequired | string | Google Gmail message ID (as returned by searchEmails or an email trigger). |
Fetch all messages in a Gmail conversation thread with their headers and bodies.
| Parameter | Type | Description |
|---|---|---|
| threadIdrequired | string | Google Gmail thread ID (as returned by searchEmails, getEmail, or an email trigger). |
List all Gmail labels with their IDs and names (needed to add or remove labels).
| Parameter | Type | Description |
|---|---|---|
| _unused | boolean | Ignore; call with {} or omit this field. |
Download an attachment from a Gmail message and store it in agent file storage.
| Parameter | Type | Description |
|---|---|---|
| messageIdrequired | string | Google Gmail message ID that contains the attachment. |
| attachmentIdrequired | string | Attachment ID from the message (as reported by the getEmail tool). |
| filenamerequired | string | Filename to store the attachment under in agent storage. |
| targetDirectory | string | Optional directory in agent storage to save into (e.g. "/attachments"). Defaults to "/attachments". |
Send an email immediately, optionally as a reply within an existing thread.
| Parameter | Type | Description |
|---|---|---|
| torequired | string | Recipient address(es), comma-separated. |
| subjectrequired | string | — |
| bodyrequired | string | — |
| cc | string | CC address(es), comma-separated. |
| bcc | string | BCC address(es), comma-separated. |
| threadId | string | Google Gmail thread ID to attach this message to (for replies). |
| inReplyToMessageId | string | RFC 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 an existing Gmail draft.
| Parameter | Type | Description |
|---|---|---|
| draftIdrequired | string | Google Gmail draft ID to send (as returned by createDraft). |
Move a Gmail message to the Trash. The message is recoverable, not permanently deleted.
| Parameter | Type | Description |
|---|---|---|
| messageIdrequired | string | Google Gmail message ID to move to Trash (recoverable). |
Create a new Gmail label.
| Parameter | Type | Description |
|---|---|---|
| namerequired | string | Label 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
googleGmailReceiveEmailTriggers when a new email is received.
Filters
| Parameter | Type | Description |
|---|---|---|
| senderPattern | string | — |
| subjectPattern | string | — |
| bodyContains | string | — |
| hasAttachment | boolean | — |
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