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

# Gmail

> Comprehensive email management with advanced search and filtering

## Overview

Integrate Gmail to manage emails, labels, filters, and attachments directly from CORE. Access 20+ tools for complete email management including sending, drafting, advanced search, batch operations, and automation without leaving your workspace.

## Setup Guide

* `Authentication Type` : OAuth 2.0 (Google)

## How to Connect

1. Navigate to [CORE Dashboard](https://app.getcore.me) → **Integrations**
2. Click on the **Gmail** card
3. Click **Connect** to authorize CORE
4. You'll be redirected to Google to authorize the application
5. Grant the required permissions
6. You'll be redirected back to CORE once connected

## Use Cases

#### Action Use Cases

When you ask CORE to perform Gmail tasks, it uses MCP tools to execute your requests:

<AccordionGroup>
  <Accordion title="Send and Draft Emails" icon="envelope">
    **Scenario**: Create and send emails programmatically with attachments and formatting

    ```
    "Send an email to client@example.com with subject 'Project Update'
    and attach the Q4 report PDF from my desktop"
    ```

    The agent will use `send_email` to send immediately with HTML formatting, multiple recipients (To, CC, BCC), attachments, and threading support. Use `draft_email` to create a draft for later modification.
  </Accordion>

  <Accordion title="Search Email History" icon="search">
    **Scenario**: Find emails using powerful Gmail search syntax

    ```
    "Search for all emails from client@example.com sent after January 1st
    that have attachments and contain the word 'invoice'"
    ```

    The agent will use `search_emails` with Gmail's query syntax to find emails by sender, subject, date range, attachments, and complex criteria with automatic timezone conversion.
  </Accordion>

  <Accordion title="Manage Labels and Filters" icon="tag">
    **Scenario**: Organize and automate email management

    ```
    "Create a label called 'Important Clients', then set up a filter
    to automatically apply this label to emails from client@example.com"
    ```

    The agent will:

    1. Use `create_label` to create custom labels for categorization
    2. Use `create_filter_from_template` to automatically organize incoming mail
    3. Apply filters to individual or batch emails for organization
  </Accordion>

  <Accordion title="Process Attachments" icon="file">
    **Scenario**: Download and manage email attachments

    ```
    "Find the latest email from finance@company.com with PDF attachments
    and download all attachments to my Downloads folder"
    ```

    The agent will first use `read_email` to get attachment IDs and metadata (filename, size, MIME type), then use `download_attachment` to save them to custom locations.
  </Accordion>

  <Accordion title="Batch Email Operations" icon="list">
    **Scenario**: Efficiently handle large numbers of emails

    ```
    "Find all emails from last month labeled 'newsletter'
    and delete them in batches"
    ```

    The agent will use `search_emails` to find matching emails, then use `batch_delete_emails` to process thousands of emails in controlled batches with automatic error handling and rate limit management.
  </Accordion>

  <Accordion title="Email Automation" icon="bolt">
    **Scenario**: Build automated workflows for email management

    ```
    "Search for all unread emails from support@example.com,
    apply the 'Support' label, and mark them as read"
    ```

    The agent will combine `search_emails` with `batch_modify_emails` to search for emails matching criteria, apply labels automatically, and create filters for ongoing automation.
  </Accordion>
</AccordionGroup>

#### Proactive Use Cases

With webhooks enabled, CORE monitors Gmail 24/7 and acts automatically based on your instructions:

<AccordionGroup>
  <Accordion title="VIP Email Routing" icon="star">
    **Trigger**: Email received from specific domain or sender

    **Automated Action**: Forward to WhatsApp and prioritize

    ```
    "When I receive an email from @importantclient.com,
    immediately forward the subject and preview to my WhatsApp,
    mark it with 'VIP' label,
    and save sender details to CORE memory"
    ```

    Never miss important emails. CORE routes critical messages to your preferred channel and flags them for immediate attention.
  </Accordion>

  <Accordion title="Auto-Extract Invoice Data" icon="file-invoice">
    **Trigger**: Email received with "invoice" in subject from accounting domain

    **Automated Action**: Extract data and create tracking entry

    ```
    "When an invoice email arrives from accounting@company.com,
    extract the invoice number, amount, and due date,
    save to CORE memory with label 'invoices',
    and create a task in Todoist to process it"
    ```

    Automate invoice tracking. CORE extracts structured data from emails and creates action items across your workflow.
  </Accordion>

  <Accordion title="Support Ticket Auto-Filing" icon="life-ring">
    **Trigger**: Email received at support email address

    **Automated Action**: Create Linear issue and auto-respond

    ```
    "When an email arrives at support@company.com,
    create a Linear issue with the email content,
    assign it to the support team,
    and send an auto-reply confirming we received their message"
    ```

    Convert emails to tickets instantly. CORE creates tracking issues in Linear and sends confirmation replies automatically.
  </Accordion>

  <Accordion title="Newsletter Auto-Archiving" icon="newspaper">
    **Trigger**: Email received from newsletter senders

    **Automated Action**: Organize and summarize

    ```
    "When a newsletter arrives (identified by 'unsubscribe' link),
    apply the 'Newsletters' label,
    extract key headlines,
    save to CORE memory for weekly digest,
    and mark as read"
    ```

    Tame newsletter overload. CORE automatically categorizes, extracts insights, and organizes newsletters for later review.
  </Accordion>

  <Accordion title="Meeting Email Parser" icon="calendar">
    **Trigger**: Email contains meeting invitation or calendar event

    **Automated Action**: Add to calendar and prep materials

    ```
    "When an email contains a meeting invitation,
    extract the date, time, and attendees,
    add it to Google Calendar,
    search CORE memory for past context with attendees,
    and send me a prep summary 1 hour before the meeting"
    ```

    Prepare for meetings automatically. CORE parses invitations, schedules events, and provides context from past interactions.
  </Accordion>

  <Accordion title="Attachment Auto-Processing" icon="paperclip">
    **Trigger**: Email received with PDF attachment from specific sender

    **Automated Action**: Download, extract, and notify

    ```
    "When I receive an email with a PDF from contracts@company.com,
    download the attachment,
    extract key terms and dates,
    save to CORE memory with label 'contracts',
    and notify legal team on Slack"
    ```

    Process attachments intelligently. CORE downloads files, extracts information, and routes to the right team automatically.
  </Accordion>
</AccordionGroup>

## Scopes

* `gmail.send` - Send emails on behalf of the user
* `gmail.compose` - Create and modify drafts
* `gmail.readonly` - Read email messages and settings
* `gmail.modify` - Manage labels and organize emails
* `gmail.labels` - Create and manage labels
* `gmail.settings.basic` - Manage filters and email settings
* `gmail.metadata` - Access email headers and metadata

## Available MCP Tools

The Gmail integration provides 20+ tools for comprehensive email management:

<Tabs>
  <Tab title="Email Management">
    | Tool Name           | Description                                                                   |
    | ------------------- | ----------------------------------------------------------------------------- |
    | `send_email`        | Send a new email with support for attachments, HTML formatting, and threading |
    | `draft_email`       | Create a draft email without sending it for later modification                |
    | `read_email`        | Retrieve the full content of a specific email message with headers and body   |
    | `read_email_thread` | Retrieve all messages in an email thread/conversation in chronological order  |
    | `modify_email`      | Modify email labels (move to folders, apply/remove tags)                      |
    | `delete_email`      | Permanently delete an email message                                           |
  </Tab>

  <Tab title="Search & Filter">
    | Tool Name                     | Description                                                                     |
    | ----------------------------- | ------------------------------------------------------------------------------- |
    | `search_emails`               | Search for emails using Gmail's powerful search syntax with timezone conversion |
    | `create_filter`               | Create a new Gmail filter with custom criteria and actions                      |
    | `create_filter_from_template` | Create a filter using a pre-defined template for common scenarios               |
    | `list_filters`                | Retrieve all Gmail filters with their criteria and actions                      |
    | `get_filter`                  | Get details of a specific Gmail filter by ID                                    |
    | `delete_filter`               | Delete a Gmail filter                                                           |
  </Tab>

  <Tab title="Label Management">
    | Tool Name             | Description                                                    |
    | --------------------- | -------------------------------------------------------------- |
    | `list_email_labels`   | Retrieve all available Gmail labels (system and user-created)  |
    | `create_label`        | Create a new Gmail label for organizing emails                 |
    | `update_label`        | Update properties of an existing Gmail label                   |
    | `delete_label`        | Delete a Gmail label (emails keep their other labels)          |
    | `get_or_create_label` | Get an existing label by name or create it if it doesn't exist |
  </Tab>

  <Tab title="Batch Operations">
    | Tool Name             | Description                                               |
    | --------------------- | --------------------------------------------------------- |
    | `batch_modify_emails` | Modify labels for multiple emails efficiently in batches  |
    | `batch_delete_emails` | Permanently delete multiple emails efficiently in batches |
  </Tab>

  <Tab title="Attachments">
    | Tool Name             | Description                                                  |
    | --------------------- | ------------------------------------------------------------ |
    | `download_attachment` | Download an email attachment to a specified location on disk |
  </Tab>
</Tabs>

## Triggers

Gmail triggers enable CORE's Meta Agent to wake up and act proactively when events are detected via scheduled polling.

<Tabs>
  <Tab title="Messages">
    | Event                     | Description                                       |
    | ------------------------- | ------------------------------------------------- |
    | `GMAIL_MESSAGE_RECEIVED`  | Triggered when a new email is received            |
    | `GMAIL_MESSAGE_SENT`      | Triggered when an email is sent from your account |
    | `GMAIL_MESSAGE_LABELED`   | Triggered when a label is added to an email       |
    | `GMAIL_MESSAGE_UNLABELED` | Triggered when a label is removed from an email   |
    | `GMAIL_MESSAGE_STARRED`   | Triggered when an email is starred                |
    | `GMAIL_MESSAGE_TRASHED`   | Triggered when an email is moved to trash         |
  </Tab>

  <Tab title="Threads">
    | Event                   | Description                              |
    | ----------------------- | ---------------------------------------- |
    | `GMAIL_THREAD_RECEIVED` | Triggered when a new email thread starts |
    | `GMAIL_THREAD_REPLIED`  | Triggered when you reply to a thread     |
  </Tab>

  <Tab title="Labels">
    | Event                 | Description                                   |
    | --------------------- | --------------------------------------------- |
    | `GMAIL_LABEL_CREATED` | Triggered when a new label is created         |
    | `GMAIL_LABEL_UPDATED` | Triggered when a label is renamed or modified |
    | `GMAIL_LABEL_DELETED` | Triggered when a label is deleted             |
  </Tab>
</Tabs>

## Need Help?

Join our [Discord community](https://discord.gg/dVTC3BmgEq) for support in **#core-support**
