Gmail Integration: Read & Send Email via AI
PocketPaw provides 9 tools for comprehensive Gmail management: search, read, send, label management, trash, and bulk operations.
Setup
- Set up Google OAuth credentials
- Enable the Gmail API in your Google Cloud project
- Authorize PocketPaw to access your Gmail
Tools
gmail_search
Search your inbox using Gmail search syntax (from:, subject:, is:unread, newer_than:1d, etc.):
User: Find emails from John about the project deadlineAgent: [uses gmail_search] → Found 3 emails: 1. "Re: Project deadline" from [email protected] (Jan 15) 2. "Deadline update" from [email protected] (Jan 12) 3. "Project timeline" from [email protected] (Jan 8)Supports a max_results parameter (default: 5, max: 20).
gmail_read
Read the full content of a specific email by message ID:
User: Read the first emailAgent: [uses gmail_read] → Subject: "Re: Project deadline" From: [email protected] Date: Jan 15, 2024 Content: "Hi, the deadline has been moved to..."gmail_send
Send an email (plain text):
User: Reply to John saying we'll meet the deadlineAgent: [uses gmail_send] → Email sent to [email protected]gmail_list_labels
List all Gmail labels with their IDs and types:
User: Show me my Gmail labelsAgent: [uses gmail_list_labels] → - INBOX (system) - SENT (system) - Work/Projects (user) -- Label_42 - Newsletters (user) -- Label_15gmail_create_label
Create a new Gmail label. Use / for nested labels:
User: Create a label called "Work/Urgent"Agent: [uses gmail_create_label] → Created label "Work/Urgent" (Label_53)gmail_modify
Add or remove labels on a single email. Common label IDs: INBOX, SPAM, TRASH, UNREAD, STARRED, IMPORTANT.
User: Star that email and mark it as importantAgent: [uses gmail_modify] → Added STARRED, IMPORTANT to messagegmail_trash
Move a message to trash:
User: Trash the spam emailAgent: [uses gmail_trash] → Message moved to trashgmail_batch_modify
Bulk label operations on multiple messages at once:
User: Mark all 5 newsletters as read and archive themAgent: [uses gmail_batch_modify] → Modified 5 messages: removed UNREAD, INBOXConfiguration
| Setting | Env Variable | Description |
|---|---|---|
| Client ID | POCKETPAW_GOOGLE_CLIENT_ID | Google OAuth client ID |
| Client secret | POCKETPAW_GOOGLE_CLIENT_SECRET | Google OAuth client secret |
Policy Group
All Gmail tools belong to group:gmail.
# Enable Gmail toolsexport POCKETPAW_TOOLS_ALLOW="group:gmail"
# Or disableexport POCKETPAW_TOOLS_DENY="group:gmail"Required Scopes
PocketPaw requests these Gmail scopes:
gmail.readonly— For search, read, and label listinggmail.send— For sending emailsgmail.modify— For label management, trash, and bulk operations
Related
Google Calendar
List, create, and search calendar events with natural language.
Google Drive
List, download, upload, and share files in Google Drive.
OAuth Framework
How PocketPaw handles Google OAuth tokens and refresh flows.