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
- Navigate to Agents and select your agent.
- Go to the Tools section and click Add Tool.
- Select Gmail.
- Click Connect Google Account.
Step 2: Authorize Access
- Sign in with the Gmail account you want the agent to use.
- 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
- Click Allow.
Step 3: Configure the Tool
| Setting | Description |
|---|---|
| Allowed Actions | Select which email actions the agent can perform |
| Send Restrictions | Optionally restrict which domains the agent can email |
| Signature | Default email signature to append to outgoing messages |
Available Actions
| Action | Description |
|---|---|
| Read Email | Open and read the content of a specific email |
| Search Emails | Search the inbox using Gmail search syntax (from, subject, date, labels) |
| Send Email | Compose and send a new email with subject, body, recipients, and attachments |
| Reply to Email | Send a reply to an existing email thread |
| Create Draft | Save an email as a draft for review before sending |
| Manage Labels | Add or remove labels on emails |
| List Emails | Retrieve 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
| Field | Value |
|---|---|
| Name | Email Assistant |
| Model | GPT-4o |
| Tools | Gmail |
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:
| Search | Example | Description |
|---|---|---|
| From | from:sarah@company.com | Emails from a specific sender |
| Subject | subject:invoice | Emails with a keyword in the subject |
| Date range | after:2026/03/01 before:2026/03/07 | Emails within a date range |
| Has attachment | has:attachment | Emails with attachments |
| Label | label:important | Emails with a specific label |
| Unread | is:unread | Unread emails only |
| Combined | from:client.com is:unread has:attachment | Multiple 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:
| Combination | Use Case |
|---|---|
| Gmail + Google Calendar | Send calendar invites after booking appointments |
| Gmail + Google Sheets | Log email data into a tracking spreadsheet |
| Gmail + SMS | Send an SMS notification when an urgent email arrives |
| Gmail + Knowledge Base | Draft responses using information from your docs |
| Gmail + CRM Webhook | Update 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
| Issue | Solution |
|---|---|
| "Not authorized" error | Re-connect your Google account. OAuth tokens expire after extended periods. |
| Can't send emails | Ensure "Send Email" is in the agent's Allowed Actions. Check send restrictions if configured. |
| Search returns no results | Verify the search query. Try broadening the date range or simplifying terms. |
| Emails going to spam | If 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.