Tools

Gmail

Connect Gmail to your agents for reading, searching, sending, and managing emails automatically.

Gmail Integration

Give your agents the ability to read, search, send, and manage emails through Gmail. Build agents that handle email triage, send follow-ups, draft responses, and automate email workflows.

Connecting Gmail

Step 1: Start the OAuth Flow

  1. Navigate to Agents and select your agent.
  2. Go to the Tools section and click Add Tool.
  3. Select Gmail.
  4. Click Connect Google Account.

Step 2: Authorize Access

  1. Sign in with the Gmail account you want the agent to use.
  2. Review the permissions:
    • Read your email — search and read messages
    • Send email on your behalf — compose and send messages
    • Manage labels — organize emails
    • Manage drafts — create and edit drafts
  3. Click Allow.

Step 3: Configure the Tool

SettingDescription
Allowed ActionsSelect which email actions the agent can perform
Send RestrictionsOptionally restrict which domains the agent can email
SignatureDefault email signature to append to outgoing messages

Available Actions

ActionDescription
Read EmailOpen and read the content of a specific email
Search EmailsSearch the inbox using Gmail search syntax (from, subject, date, labels)
Send EmailCompose and send a new email with subject, body, recipients, and attachments
Reply to EmailSend a reply to an existing email thread
Create DraftSave an email as a draft for review before sending
Manage LabelsAdd or remove labels on emails
List EmailsRetrieve recent emails from inbox, sent, or specific labels

Email Automation Use Cases

Inbox Triage

Have an agent monitor and categorize incoming emails:

Agent instructions:
"Check the inbox for new emails. Categorize each one as:
- Urgent: customer complaints, payment issues
- Sales: inquiries, demo requests
- Support: bug reports, feature requests
- Newsletter: marketing emails, subscriptions

Apply the appropriate Gmail label and summarize the inbox for me."

Auto-Responder

Set up automatic responses for common inquiries:

Agent instructions:
"When you find emails asking about pricing:
1. Search for the latest pricing info in the knowledge base
2. Draft a personalized reply with relevant pricing details
3. Save as draft for review

When you find emails requesting a demo:
1. Reply with our demo booking link: https://cal.com/acme/demo
2. Include a brief overview of the product"

Follow-Up Sequences

Automate follow-up emails after key events:

Agent instructions:
"After a meeting is completed on Google Calendar:
1. Find the attendee's email from the calendar event
2. Send a follow-up email thanking them for their time
3. Include any action items discussed
4. Attach relevant documents if mentioned"

Example: Email Assistant Agent

Build an agent that manages your email workflow.

Agent Setup

FieldValue
NameEmail Assistant
ModelGPT-4o
ToolsGmail

Agent Instructions

You are an email assistant. You help manage the inbox and compose emails.

CAPABILITIES:
- Search and read emails
- Summarize email threads
- Draft replies and new emails
- Organize emails with labels

RULES:
- Never send an email without explicit confirmation from the user
- Always show the draft before sending
- When replying, maintain a professional tone
- Include the original message context in replies
- If an email requires urgent attention, flag it immediately

WORKFLOW FOR COMPOSING:
1. Ask who the email is for and what it should say
2. Draft the email and show it to the user
3. Make any requested changes
4. Only send when the user says "send it" or "looks good"

Sample Conversation

User:   "Check my inbox for any emails from investors this week."

Agent:  [Searches Gmail: from:(*@sequoia.com OR *@a16z.com) after:2026/03/01]
        "You have 2 emails from investors this week:

         1. Sarah Chen (Sequoia) - 'Follow up: Series B Discussion'
            Received: March 3 — Asking to schedule a call this week

         2. Mike Ross (a16z) - 'Due Diligence Documents'
            Received: March 4 — Requesting your latest financials

         Would you like me to read either of these in full or draft
         a reply?"

User:   "Draft a reply to Sarah. I'm free Thursday at 2 PM."

Agent:  "Here's the draft reply:

         To: sarah.chen@sequoia.com
         Subject: Re: Follow up: Series B Discussion

         Hi Sarah,

         Thanks for following up! I'd love to continue our conversation.
         I'm available Thursday at 2:00 PM — would that work for you?

         Happy to jump on a Zoom call or meet in person, whichever
         you prefer.

         Best,
         [Your name]

         Shall I send this or would you like any changes?"

User:   "Looks good, send it."

Agent:  [Sends the reply]
        "Sent! The reply has been delivered to Sarah. I'll keep an eye
         out for her response."

Gmail Search Syntax

Your agent can use Gmail's powerful search syntax:

SearchExampleDescription
Fromfrom:sarah@company.comEmails from a specific sender
Subjectsubject:invoiceEmails with a keyword in the subject
Date rangeafter:2026/03/01 before:2026/03/07Emails within a date range
Has attachmenthas:attachmentEmails with attachments
Labellabel:importantEmails with a specific label
Unreadis:unreadUnread emails only
Combinedfrom:client.com is:unread has:attachmentMultiple conditions

The agent understands natural language and converts it to the right search query automatically.

Combining with Other Tools

Gmail works great alongside other tools:

CombinationUse Case
Gmail + Google CalendarSend calendar invites after booking appointments
Gmail + Google SheetsLog email data into a tracking spreadsheet
Gmail + SMSSend an SMS notification when an urgent email arrives
Gmail + Knowledge BaseDraft responses using information from your docs
Gmail + CRM WebhookUpdate your CRM when replying to leads

Security Considerations

  • OAuth tokens are encrypted and stored securely. thinnestAI never has access to your Google password.
  • Revoke access at any time from your Google Account Security page.
  • Send restrictions — Limit which domains the agent can email to prevent accidental sends.
  • Draft mode — Configure the agent to always save as draft instead of sending directly, giving you a review step.

Troubleshooting

IssueSolution
"Not authorized" errorRe-connect your Google account. OAuth tokens expire after extended periods.
Can't send emailsEnsure "Send Email" is in the agent's Allowed Actions. Check send restrictions if configured.
Search returns no resultsVerify the search query. Try broadening the date range or simplifying terms.
Emails going to spamIf recipients report your agent's emails as spam, verify your sending domain's SPF/DKIM records.

Next Steps

  • Google Calendar — Pair email with scheduling for complete workflow automation.
  • Google Sheets — Log email data into spreadsheets.
  • SMS — Add text messaging to your communication toolkit.

On this page