Google Integration
Google (Gmail, Calendar, and Drive) is Town’s core integration. It’s required for your assistant to function.
What’s included
Gmail access
Your assistant can:
- Read emails — Access email content and metadata
- Search emails — Use Gmail search syntax
- Manage labels — Create, add, remove labels
- Archive/trash — Organize emails
- Send emails — Send and reply to emails
- Create drafts — Prepare emails for review
- Access attachments — Download and process attachments
Google Calendar
Your assistant can:
- List events — See upcoming calendar events
- Get event details — Access specific event information
- Create events — Schedule meetings with attendees and Google Meet
- Edit events — Modify events or RSVP to invitations
- Delete events — Cancel or remove events
Google Drive
Your assistant can:
- Read files — Access documents and spreadsheets
- Write files — Create and update content
- Search Drive — Find files across your Drive
Connecting Gmail
First-time setup
- Sign up for Town
- Click Connect Gmail Account
- Select your Google account
- Review and approve permissions
- You’re connected!
Adding additional accounts
- Go to Settings → Accounts
- Click Add Account
- Complete the OAuth flow
- New account is now available
Required permissions
Town requests these Google scopes:
| Permission | Purpose |
|---|---|
| Read email | Your assistant reads and analyzes emails |
| Send email | Your assistant sends emails (with approval in HITL) |
| Manage labels | Organize and filter emails |
| Calendar access | View and manage calendar events |
| Drive access | Read and write documents and files |
Town uses OAuth — your password is never stored. You can revoke access anytime from your Google Account settings.
Gmail tools
Read & search
| Tool | Description |
|---|---|
read_email | Read full email content |
search_emails | Search using Gmail syntax |
search_emails_analyzed | AI-filtered search results |
Organize
| Tool | Description |
|---|---|
add_label | Add label to email |
remove_label | Remove label from email |
archive_email | Archive (remove from inbox) |
trash_email | Move to trash |
move_email | Move to specific label |
list_labels | List available labels |
Send
| Tool | Description |
|---|---|
send_email_to_user | Send to account owner only |
create_draft | Create draft for review |
Attachments
| Tool | Description |
|---|---|
list_attachments | List email attachments |
get_attachment_to_sandbox | Download for processing |
Calendar tools
| Tool | Description |
|---|---|
list_calendar_events | Get events in time range |
get_calendar_event | Get specific event details |
create_calendar_event | Create events with attendees and Google Meet |
edit_calendar_event | Edit events or RSVP to invitations |
delete_calendar_event | Delete/cancel calendar events |
Delete with caution. If you are the organizer, delete_calendar_event will cancel the event for ALL attendees. If you’re just an attendee, it only removes the event from your calendar.
Drive tools
| Tool | Description |
|---|---|
read_file | Read file contents |
write_file | Create or update files |
read_spreadsheet | Read Google Sheets data |
update_sheet_data | Update spreadsheet cells |
read_doc | Read Google Docs content |
update_doc | Update document content |
Gmail search syntax
The search_emails tool uses Gmail’s search syntax:
| Query | Meaning |
|---|---|
from:john@example.com | From specific sender |
to:me | Sent directly to you |
subject:meeting | Subject contains word |
has:attachment | Has attachments |
is:unread | Unread emails |
is:starred | Starred emails |
in:inbox | In inbox (not archived) |
newer_than:7d | From last 7 days |
older_than:1m | Older than 1 month |
label:important | Has specific label |
Combine with AND (space) or OR:
from:john@example.com subject:report newer_than:30dMultiple accounts
When you have multiple Gmail accounts:
Per-account triggers
Configure triggers to fire for specific accounts or all accounts.
Account context
When a workflow runs, it has access to the triggering account’s:
- Email address
- Labels
- Calendar
- Drive
- Sent mail history
Managing accounts
In Settings → Accounts:
- View connected accounts — See all Gmail accounts
- Set primary — Default account for new workflows
- Remove account — Disconnect an account
- Re-authorize — Fix permission issues
Troubleshooting
Permission errors
If workflows fail with permission errors:
- Go to Settings → Accounts
- Click Re-authorize on the account
- Complete the OAuth flow again
Rate limits
Gmail has API rate limits. If you see rate limit errors:
- Reduce trigger frequency
- Space out scheduled workflows
- Use queue-based processing
Missing emails
If workflows aren’t seeing emails:
- Check the account scope in triggers
- Verify search queries are correct
- Check if emails are in trash/spam