> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinkfish.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# gmail

> Email send, read, search, and label management

**Server path:** `/gmail` | **Type:** Application | **PCID required:** Yes

## Tools

| Tool                                                                  | Description                                                                                                                                                                                                                                                      |
| --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`gmail_send_email`](#gmail_send_email)                               | Send an email via Gmail. Supports CC/BCC, HTML content, attachments via URL, and email threading for replies                                                                                                                                                     |
| [`gmail_draft_email`](#gmail_draft_email)                             | Create a draft email in Gmail for user review before sending. Same options as gmail\_send\_email                                                                                                                                                                 |
| [`gmail_read_email`](#gmail_read_email)                               | Read the full content of an email including body, headers, and attachment info. Use messageId from gmail\_search\_emails                                                                                                                                         |
| [`gmail_search_emails`](#gmail_search_emails)                         | Search emails using Gmail search syntax. Returns structured email data including id, subject, from, to, cc, date, snippet, labelIds, and optionally attachments and body content. Supports bodyPreview when includeBody is "preview", "text", "html", or "both". |
| [`gmail_modify_email`](#gmail_modify_email)                           | Add or remove labels on an email. Use to mark read/unread, star, move to folders, or apply custom labels                                                                                                                                                         |
| [`gmail_list_email_labels`](#gmail_list_email_labels)                 | List all Gmail labels (both system and custom). Returns label IDs needed for gmail\_modify\_email                                                                                                                                                                |
| [`gmail_create_label`](#gmail_create_label)                           | Create a new custom Gmail label for organizing emails. Returns the label ID for use with gmail\_modify\_email                                                                                                                                                    |
| [`gmail_update_label`](#gmail_update_label)                           | Rename a label or change its visibility settings                                                                                                                                                                                                                 |
| [`gmail_delete_label`](#gmail_delete_label)                           | Delete a custom label. Emails with this label are NOT deleted, only the label is removed from them                                                                                                                                                               |
| [`gmail_get_or_create_label`](#gmail_get_or_create_label)             | Get a label by name, creating it if it does not exist. Idempotent - safe to call multiple times                                                                                                                                                                  |
| [`gmail_batch_modify_emails`](#gmail_batch_modify_emails)             | Apply label changes to multiple emails at once. More efficient than calling gmail\_modify\_email repeatedly                                                                                                                                                      |
| [`gmail_batch_delete_emails`](#gmail_batch_delete_emails)             | Delete multiple Gmail messages by moving them to the trash using batch processing. Messages can be recovered from trash within 30 days.                                                                                                                          |
| [`gmail_archive_email`](#gmail_archive_email)                         | Archive an email (removes from inbox but keeps it accessible in All Mail). Email is NOT deleted                                                                                                                                                                  |
| [`gmail_trash_email`](#gmail_trash_email)                             | Move email to Trash. Can be recovered within 30 days.                                                                                                                                                                                                            |
| [`gmail_download_attachment`](#gmail_download_attachment)             | Download an email attachment and store it as an artifact. Returns a link to the stored file, metadata, and a text preview for supported types (PDF, DOCX, XLSX, PPTX). Get attachmentId from gmail\_search\_emails or gmail\_read\_email                         |
| [`gmail_list_trigger_capabilities`](#gmail_list_trigger_capabilities) | List available Gmail trigger types for automation. Used by the trigger configuration system                                                                                                                                                                      |
| [`gmail_poll_trigger`](#gmail_poll_trigger)                           | Poll for new emails since last check. Used by automation triggers. Returns full email data including body and attachment info                                                                                                                                    |

***

## gmail\_send\_email

Send an email via Gmail. Supports CC/BCC, HTML content, attachments via URL, and email threading for replies

**Parameters:**

| Parameter        | Type      | Required | Default | Description                                                                                                                                                                                                                                                                                                                        |
| ---------------- | --------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `to`             | string\[] | Yes      | —       | Recipient email addresses. Example: \["[john@example.com](mailto:john@example.com)", "[jane@example.com](mailto:jane@example.com)"]                                                                                                                                                                                                |
| `subject`        | string    | Yes      | —       | Email subject line. For replies, prefix with "Re: " to maintain thread context                                                                                                                                                                                                                                                     |
| `body`           | string    | Yes      | —       | Email body content. Plain text by default. Set isHtml=true for HTML content                                                                                                                                                                                                                                                        |
| `isHtml`         | boolean   | No       | —       | Set to true when body contains HTML (e.g., \<p>Hello\</p>). Default: false (plain text)                                                                                                                                                                                                                                            |
| `cc`             | string\[] | No       | —       | CC recipients. Example: \["[manager@example.com](mailto:manager@example.com)"]                                                                                                                                                                                                                                                     |
| `bcc`            | string\[] | No       | —       | BCC recipients (hidden from other recipients). Example: \["[archive@example.com](mailto:archive@example.com)"]                                                                                                                                                                                                                     |
| `replyTo`        | string    | No       | —       | Where replies should go if different from sender. Example: "[support@example.com](mailto:support@example.com)"                                                                                                                                                                                                                     |
| `from`           | string    | No       | —       | Send as a Gmail alias (must be configured in Gmail settings). Example: "[sales@mycompany.com](mailto:sales@mycompany.com)"                                                                                                                                                                                                         |
| `threadId`       | string    | No       | —       | Thread ID to add this email to an existing conversation. Get from gmail\_search\_emails or gmail\_read\_email                                                                                                                                                                                                                      |
| `inReplyTo`      | string    | No       | —       | Message-ID header of the email being replied to. Required with threadId for proper threading. Get from email headers                                                                                                                                                                                                               |
| `references`     | string    | No       | —       | Full References header chain (space-separated Message-IDs of all ancestors). Optional but recommended for replies in long threads — extends the thread chain so mail clients group follow-ups correctly. Example: "\<[root@x.com](mailto:root@x.com)> \<[reply1@x.com](mailto:reply1@x.com)>". Defaults to inReplyTo when omitted. |
| `attachmentUrls` | string\[] | No       | —       | URLs of files to attach. Supports any publicly accessible URL. Example: \["[https://example.com/report.pdf](https://example.com/report.pdf)"]                                                                                                                                                                                      |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "to": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Recipient email addresses. Example: [\"john@example.com\", \"jane@example.com\"]"
      },
      "subject": {
        "type": "string",
        "description": "Email subject line. For replies, prefix with \"Re: \" to maintain thread context"
      },
      "body": {
        "type": "string",
        "description": "Email body content. Plain text by default. Set isHtml=true for HTML content"
      },
      "isHtml": {
        "type": "boolean",
        "description": "Set to true when body contains HTML (e.g., <p>Hello</p>). Default: false (plain text)"
      },
      "cc": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "CC recipients. Example: [\"manager@example.com\"]"
      },
      "bcc": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "BCC recipients (hidden from other recipients). Example: [\"archive@example.com\"]"
      },
      "replyTo": {
        "type": "string",
        "description": "Where replies should go if different from sender. Example: \"support@example.com\""
      },
      "from": {
        "type": "string",
        "description": "Send as a Gmail alias (must be configured in Gmail settings). Example: \"sales@mycompany.com\""
      },
      "threadId": {
        "type": "string",
        "description": "Thread ID to add this email to an existing conversation. Get from gmail_search_emails or gmail_read_email"
      },
      "inReplyTo": {
        "type": "string",
        "description": "Message-ID header of the email being replied to. Required with threadId for proper threading. Get from email headers"
      },
      "references": {
        "type": "string",
        "description": "Full References header chain (space-separated Message-IDs of all ancestors). Optional but recommended for replies in long threads — extends the thread chain so mail clients group follow-ups correctly. Example: \"<root@x.com> <reply1@x.com>\". Defaults to inReplyTo when omitted."
      },
      "attachmentUrls": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "URLs of files to attach. Supports any publicly accessible URL. Example: [\"https://example.com/report.pdf\"]"
      }
    },
    "required": [
      "PCID",
      "to",
      "subject",
      "body"
    ]
  }
  ```
</Expandable>

***

## gmail\_draft\_email

Create a draft email in Gmail for user review before sending. Same options as gmail\_send\_email

**Parameters:**

| Parameter        | Type      | Required | Default | Description                                                                                                                                                            |
| ---------------- | --------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `to`             | string\[] | Yes      | —       | Recipient email addresses. Example: \["[john@example.com](mailto:john@example.com)", "[jane@example.com](mailto:jane@example.com)"]                                    |
| `subject`        | string    | Yes      | —       | Email subject line. For replies, prefix with "Re: " to maintain thread context                                                                                         |
| `body`           | string    | Yes      | —       | Email body content. Plain text by default. Set isHtml=true for HTML content                                                                                            |
| `isHtml`         | boolean   | No       | —       | Set to true when body contains HTML (e.g., \<p>Hello\</p>). Default: false (plain text)                                                                                |
| `cc`             | string\[] | No       | —       | CC recipients. Example: \["[manager@example.com](mailto:manager@example.com)"]                                                                                         |
| `bcc`            | string\[] | No       | —       | BCC recipients (hidden from other recipients). Example: \["[archive@example.com](mailto:archive@example.com)"]                                                         |
| `replyTo`        | string    | No       | —       | Where replies should go if different from sender. Example: "[support@example.com](mailto:support@example.com)"                                                         |
| `from`           | string    | No       | —       | Send as a Gmail alias (must be configured in Gmail settings). Example: "[sales@mycompany.com](mailto:sales@mycompany.com)"                                             |
| `threadId`       | string    | No       | —       | Thread ID to add this draft to an existing conversation. Get from gmail\_search\_emails or gmail\_read\_email                                                          |
| `inReplyTo`      | string    | No       | —       | Message-ID header of the email being replied to. Required with threadId for proper threading. Get from email headers                                                   |
| `references`     | string    | No       | —       | Full References header chain (space-separated Message-IDs of all ancestors). Optional but recommended for replies in long threads. Defaults to inReplyTo when omitted. |
| `attachmentUrls` | string\[] | No       | —       | URLs of files to attach. Supports any publicly accessible URL. Example: \["[https://example.com/report.pdf](https://example.com/report.pdf)"]                          |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "to": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Recipient email addresses. Example: [\"john@example.com\", \"jane@example.com\"]"
      },
      "subject": {
        "type": "string",
        "description": "Email subject line. For replies, prefix with \"Re: \" to maintain thread context"
      },
      "body": {
        "type": "string",
        "description": "Email body content. Plain text by default. Set isHtml=true for HTML content"
      },
      "isHtml": {
        "type": "boolean",
        "description": "Set to true when body contains HTML (e.g., <p>Hello</p>). Default: false (plain text)"
      },
      "cc": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "CC recipients. Example: [\"manager@example.com\"]"
      },
      "bcc": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "BCC recipients (hidden from other recipients). Example: [\"archive@example.com\"]"
      },
      "replyTo": {
        "type": "string",
        "description": "Where replies should go if different from sender. Example: \"support@example.com\""
      },
      "from": {
        "type": "string",
        "description": "Send as a Gmail alias (must be configured in Gmail settings). Example: \"sales@mycompany.com\""
      },
      "threadId": {
        "type": "string",
        "description": "Thread ID to add this draft to an existing conversation. Get from gmail_search_emails or gmail_read_email"
      },
      "inReplyTo": {
        "type": "string",
        "description": "Message-ID header of the email being replied to. Required with threadId for proper threading. Get from email headers"
      },
      "references": {
        "type": "string",
        "description": "Full References header chain (space-separated Message-IDs of all ancestors). Optional but recommended for replies in long threads. Defaults to inReplyTo when omitted."
      },
      "attachmentUrls": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "URLs of files to attach. Supports any publicly accessible URL. Example: [\"https://example.com/report.pdf\"]"
      }
    },
    "required": [
      "PCID",
      "to",
      "subject",
      "body"
    ]
  }
  ```
</Expandable>

***

## gmail\_read\_email

Read the full content of an email including body, headers, and attachment info. Use messageId from gmail\_search\_emails

**Parameters:**

| Parameter   | Type   | Required | Default | Description                                                                                |
| ----------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------ |
| `messageId` | string | Yes      | —       | Email message ID to retrieve. Get from gmail\_search\_emails results or trigger event data |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "messageId": {
        "type": "string",
        "description": "Email message ID to retrieve. Get from gmail_search_emails results or trigger event data"
      }
    },
    "required": [
      "PCID",
      "messageId"
    ]
  }
  ```
</Expandable>

***

## gmail\_search\_emails

Search emails using Gmail search syntax. Returns structured email data including id, subject, from, to, cc, date, snippet, labelIds, and optionally attachments and body content. Supports bodyPreview when includeBody is "preview", "text", "html", or "both".

**Parameters:**

| Parameter     | Type   | Required | Default  | Description                                                                                                                                                                                                                                                                                     |
| ------------- | ------ | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `query`       | string | Yes      | —        | Gmail search query using Gmail search syntax                                                                                                                                                                                                                                                    |
| `maxResults`  | number | No       | `10`     | Maximum number of results to return (default: 10)                                                                                                                                                                                                                                               |
| `includeBody` | string | No       | `"none"` | Which email body format to include: "none" (default, no body content), "preview" (500-char preview using snippet, fast), "text" (full plain text body), "html" (full HTML body), or "both" (both text + HTML). Note: Options other than "none" and "preview" are slower and use more API quota. |
| `version`     | string | No       | `"1"`    | Tool version (use "1" for this version)                                                                                                                                                                                                                                                         |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "query": {
        "type": "string",
        "description": "Gmail search query using Gmail search syntax"
      },
      "maxResults": {
        "type": "number",
        "default": 10,
        "description": "Maximum number of results to return (default: 10)"
      },
      "includeBody": {
        "type": "string",
        "enum": [
          "none",
          "preview",
          "text",
          "html",
          "both"
        ],
        "default": "none",
        "description": "Which email body format to include: \"none\" (default, no body content), \"preview\" (500-char preview using snippet, fast), \"text\" (full plain text body), \"html\" (full HTML body), or \"both\" (both text + HTML). Note: Options other than \"none\" and \"preview\" are slower and use more API quota."
      },
      "version": {
        "type": "string",
        "default": "1",
        "description": "Tool version (use \"1\" for this version)"
      }
    },
    "required": [
      "PCID",
      "query"
    ]
  }
  ```
</Expandable>

***

## gmail\_modify\_email

Add or remove labels on an email. Use to mark read/unread, star, move to folders, or apply custom labels

**Parameters:**

| Parameter        | Type      | Required | Default | Description                                                                                                                           |
| ---------------- | --------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `messageId`      | string    | Yes      | —       | Email message ID to modify. Get from gmail\_search\_emails                                                                            |
| `labelIds`       | string\[] | No       | —       | Replace all labels with these. Use addLabelIds/removeLabelIds instead for partial updates                                             |
| `addLabelIds`    | string\[] | No       | —       | Labels to add. System labels: INBOX, STARRED, IMPORTANT, UNREAD, SPAM, TRASH. Or use custom label IDs from gmail\_list\_email\_labels |
| `removeLabelIds` | string\[] | No       | —       | Labels to remove. Example: remove "UNREAD" to mark as read, remove "INBOX" to archive                                                 |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "messageId": {
        "type": "string",
        "description": "Email message ID to modify. Get from gmail_search_emails"
      },
      "labelIds": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Replace all labels with these. Use addLabelIds/removeLabelIds instead for partial updates"
      },
      "addLabelIds": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Labels to add. System labels: INBOX, STARRED, IMPORTANT, UNREAD, SPAM, TRASH. Or use custom label IDs from gmail_list_email_labels"
      },
      "removeLabelIds": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Labels to remove. Example: remove \"UNREAD\" to mark as read, remove \"INBOX\" to archive"
      }
    },
    "required": [
      "PCID",
      "messageId"
    ]
  }
  ```
</Expandable>

***

## gmail\_list\_email\_labels

List all Gmail labels (both system and custom). Returns label IDs needed for gmail\_modify\_email

**Parameters:**

| Parameter  | Type      | Required | Default | Description                                          |
| ---------- | --------- | -------- | ------- | ---------------------------------------------------- |
| `labelIds` | string\[] | No       | —       | Filter to specific label IDs. Omit to get all labels |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "labelIds": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Filter to specific label IDs. Omit to get all labels"
      }
    },
    "required": [
      "PCID"
    ]
  }
  ```
</Expandable>

***

## gmail\_create\_label

Create a new custom Gmail label for organizing emails. Returns the label ID for use with gmail\_modify\_email

**Parameters:**

| Parameter               | Type   | Required | Default | Description                                                                                              |
| ----------------------- | ------ | -------- | ------- | -------------------------------------------------------------------------------------------------------- |
| `name`                  | string | Yes      | —       | Label name. Can include "/" for nested labels. Example: "Projects/Client-A"                              |
| `messageListVisibility` | string | No       | —       | Show label in message list view. "show" = visible, "hide" = hidden. Default: show                        |
| `labelListVisibility`   | string | No       | —       | Show label in sidebar. "labelShow" = always, "labelShowIfUnread" = only when unread, "labelHide" = never |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "name": {
        "type": "string",
        "description": "Label name. Can include \"/\" for nested labels. Example: \"Projects/Client-A\""
      },
      "messageListVisibility": {
        "type": "string",
        "enum": [
          "show",
          "hide"
        ],
        "description": "Show label in message list view. \"show\" = visible, \"hide\" = hidden. Default: show"
      },
      "labelListVisibility": {
        "type": "string",
        "enum": [
          "labelShow",
          "labelShowIfUnread",
          "labelHide"
        ],
        "description": "Show label in sidebar. \"labelShow\" = always, \"labelShowIfUnread\" = only when unread, \"labelHide\" = never"
      }
    },
    "required": [
      "PCID",
      "name"
    ]
  }
  ```
</Expandable>

***

## gmail\_update\_label

Rename a label or change its visibility settings

**Parameters:**

| Parameter               | Type   | Required | Default | Description                                             |
| ----------------------- | ------ | -------- | ------- | ------------------------------------------------------- |
| `id`                    | string | Yes      | —       | Label ID to update. Get from gmail\_list\_email\_labels |
| `name`                  | string | No       | —       | New name for the label                                  |
| `messageListVisibility` | string | No       | —       | Show label in message list view                         |
| `labelListVisibility`   | string | No       | —       | Show label in sidebar                                   |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "id": {
        "type": "string",
        "description": "Label ID to update. Get from gmail_list_email_labels"
      },
      "name": {
        "type": "string",
        "description": "New name for the label"
      },
      "messageListVisibility": {
        "type": "string",
        "enum": [
          "show",
          "hide"
        ],
        "description": "Show label in message list view"
      },
      "labelListVisibility": {
        "type": "string",
        "enum": [
          "labelShow",
          "labelShowIfUnread",
          "labelHide"
        ],
        "description": "Show label in sidebar"
      }
    },
    "required": [
      "PCID",
      "id"
    ]
  }
  ```
</Expandable>

***

## gmail\_delete\_label

Delete a custom label. Emails with this label are NOT deleted, only the label is removed from them

**Parameters:**

| Parameter | Type   | Required | Default | Description                                                                          |
| --------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------ |
| `id`      | string | Yes      | —       | Label ID to delete. Get from gmail\_list\_email\_labels. Cannot delete system labels |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "id": {
        "type": "string",
        "description": "Label ID to delete. Get from gmail_list_email_labels. Cannot delete system labels"
      }
    },
    "required": [
      "PCID",
      "id"
    ]
  }
  ```
</Expandable>

***

## gmail\_get\_or\_create\_label

Get a label by name, creating it if it does not exist. Idempotent - safe to call multiple times

**Parameters:**

| Parameter | Type   | Required | Default | Description                                                                        |
| --------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------- |
| `name`    | string | Yes      | —       | Label name to find or create. Example: "Processed", "To Review", "Client/ProjectX" |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "name": {
        "type": "string",
        "description": "Label name to find or create. Example: \"Processed\", \"To Review\", \"Client/ProjectX\""
      }
    },
    "required": [
      "PCID",
      "name"
    ]
  }
  ```
</Expandable>

***

## gmail\_batch\_modify\_emails

Apply label changes to multiple emails at once. More efficient than calling gmail\_modify\_email repeatedly

**Parameters:**

| Parameter        | Type      | Required | Default | Description                                                                                    |
| ---------------- | --------- | -------- | ------- | ---------------------------------------------------------------------------------------------- |
| `messageIds`     | string\[] | Yes      | —       | Array of message IDs to modify. Get from gmail\_search\_emails. Example: \["msg123", "msg456"] |
| `addLabelIds`    | string\[] | No       | —       | Labels to add to ALL messages. Example: \["STARRED", "Label\_123"]                             |
| `removeLabelIds` | string\[] | No       | —       | Labels to remove from ALL messages. Example: \["UNREAD", "INBOX"]                              |
| `batchSize`      | number    | No       | `50`    | Messages per batch. Default: 50. Reduce if timeouts occur                                      |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "messageIds": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Array of message IDs to modify. Get from gmail_search_emails. Example: [\"msg123\", \"msg456\"]"
      },
      "addLabelIds": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Labels to add to ALL messages. Example: [\"STARRED\", \"Label_123\"]"
      },
      "removeLabelIds": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Labels to remove from ALL messages. Example: [\"UNREAD\", \"INBOX\"]"
      },
      "batchSize": {
        "type": "number",
        "default": 50,
        "description": "Messages per batch. Default: 50. Reduce if timeouts occur"
      }
    },
    "required": [
      "PCID",
      "messageIds"
    ]
  }
  ```
</Expandable>

***

## gmail\_batch\_delete\_emails

Delete multiple Gmail messages by moving them to the trash using batch processing. Messages can be recovered from trash within 30 days.

**Parameters:**

| Parameter    | Type      | Required | Default | Description                                                           |
| ------------ | --------- | -------- | ------- | --------------------------------------------------------------------- |
| `messageIds` | string\[] | Yes      | —       | Array of message IDs to permanently delete. WARNING: Cannot be undone |
| `batchSize`  | number    | No       | `50`    | Messages per batch. Default: 50. Reduce if timeouts occur             |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "messageIds": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Array of message IDs to permanently delete. WARNING: Cannot be undone"
      },
      "batchSize": {
        "type": "number",
        "default": 50,
        "description": "Messages per batch. Default: 50. Reduce if timeouts occur"
      }
    },
    "required": [
      "PCID",
      "messageIds"
    ]
  }
  ```
</Expandable>

***

## gmail\_archive\_email

Archive an email (removes from inbox but keeps it accessible in All Mail). Email is NOT deleted

**Parameters:**

| Parameter   | Type   | Required | Default | Description                                                 |
| ----------- | ------ | -------- | ------- | ----------------------------------------------------------- |
| `messageId` | string | Yes      | —       | Gmail message ID to archive. Get from gmail\_search\_emails |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "messageId": {
        "type": "string",
        "description": "Gmail message ID to archive. Get from gmail_search_emails"
      }
    },
    "required": [
      "PCID",
      "messageId"
    ]
  }
  ```
</Expandable>

***

## gmail\_trash\_email

Move email to Trash. Can be recovered within 30 days.

**Parameters:**

| Parameter   | Type   | Required | Default | Description                                               |
| ----------- | ------ | -------- | ------- | --------------------------------------------------------- |
| `messageId` | string | Yes      | —       | Gmail message ID to trash. Get from gmail\_search\_emails |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "messageId": {
        "type": "string",
        "description": "Gmail message ID to trash. Get from gmail_search_emails"
      }
    },
    "required": [
      "PCID",
      "messageId"
    ]
  }
  ```
</Expandable>

***

## gmail\_download\_attachment

Download an email attachment and store it as an artifact. Returns a link to the stored file, metadata, and a text preview for supported types (PDF, DOCX, XLSX, PPTX). Get attachmentId from gmail\_search\_emails or gmail\_read\_email

**Parameters:**

| Parameter      | Type   | Required | Default | Description                                                                                                                                      |
| -------------- | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `messageId`    | string | Yes      | —       | Gmail message ID containing the attachment. Get from gmail\_search\_emails                                                                       |
| `attachmentId` | string | Yes      | —       | Attachment ID to download. Found in email attachments\[].attachmentId from gmail\_search\_emails                                                 |
| `filename`     | string | No       | —       | Override filename for the attachment. If omitted, uses original filename                                                                         |
| `mimeType`     | string | No       | —       | MIME type of the attachment (e.g. application/pdf). Get from gmail\_search\_emails attachments\[].mimeType. Used for text extraction and storage |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "messageId": {
        "type": "string",
        "description": "Gmail message ID containing the attachment. Get from gmail_search_emails"
      },
      "attachmentId": {
        "type": "string",
        "description": "Attachment ID to download. Found in email attachments[].attachmentId from gmail_search_emails"
      },
      "filename": {
        "type": "string",
        "description": "Override filename for the attachment. If omitted, uses original filename"
      },
      "mimeType": {
        "type": "string",
        "description": "MIME type of the attachment (e.g. application/pdf). Get from gmail_search_emails attachments[].mimeType. Used for text extraction and storage"
      }
    },
    "required": [
      "PCID",
      "messageId",
      "attachmentId"
    ]
  }
  ```
</Expandable>

***

## gmail\_list\_trigger\_capabilities

List available Gmail trigger types for automation. Used by the trigger configuration system

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {}
  }
  ```
</Expandable>

***

## gmail\_poll\_trigger

Poll for new emails since last check. Used by automation triggers. Returns full email data including body and attachment info

**Parameters:**

| Parameter          | Type    | Required | Default | Description                                                                                                                                                                                                                                      |
| ------------------ | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `query`            | string  | No       | —       | Filter emails with Gmail search syntax. Examples: "from:[alerts@service.com](mailto:alerts@service.com)", "subject:order", "is:unread"                                                                                                           |
| `labelIds`         | string  | No       | —       | Filter to emails with this label ID. Get ID from gmail\_list\_email\_labels                                                                                                                                                                      |
| `includeSpamTrash` | boolean | No       | —       | Include spam/trash emails. Default: false                                                                                                                                                                                                        |
| `cursor`           | string  | No       | —       | Opaque cursor returned by the previous poll. Pass it back unchanged to fetch only emails newer than the last poll. Treat as a black box: in History API mode it is a Gmail historyId; in query mode it is a JSON-encoded internalDate watermark. |
| `minTimestamp`     | number  | No       | —       | Unix timestamp (seconds). Ignore emails before this time. Typically set to trigger creation time                                                                                                                                                 |
| `maxResults`       | number  | No       | —       | Limit number of emails returned. Default: 100                                                                                                                                                                                                    |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID for Gmail connection"
      },
      "query": {
        "type": "string",
        "description": "Filter emails with Gmail search syntax. Examples: \"from:alerts@service.com\", \"subject:order\", \"is:unread\""
      },
      "labelIds": {
        "type": "string",
        "description": "Filter to emails with this label ID. Get ID from gmail_list_email_labels"
      },
      "includeSpamTrash": {
        "type": "boolean",
        "description": "Include spam/trash emails. Default: false"
      },
      "cursor": {
        "type": "string",
        "description": "Opaque cursor returned by the previous poll. Pass it back unchanged to fetch only emails newer than the last poll. Treat as a black box: in History API mode it is a Gmail historyId; in query mode it is a JSON-encoded internalDate watermark."
      },
      "minTimestamp": {
        "type": "number",
        "description": "Unix timestamp (seconds). Ignore emails before this time. Typically set to trigger creation time"
      },
      "maxResults": {
        "type": "number",
        "description": "Limit number of emails returned. Default: 100"
      }
    },
    "required": [
      "PCID"
    ]
  }
  ```
</Expandable>
