Prerequisites
- A Google account with Gmail enabled
- project_contributor access in your workspace
- Gmail API enabled in your Google Cloud project (handled automatically when connecting through the Console)
Connect in AgentRuntime
Connect Google
On Connections, use the Google account card and complete OAuth. Enable the Gmail service for your account. See Google Workspace setup and Connections.
Add gmail MCP instance
Go to MCP, click Add instance for gmail. Open Instance config, wire your Google connection, and set the profile active.
What you can build
- Run notifications — On workflow success or failure,
send_emailto operators with run ID and a Command Center link. - Inbox triage —
search_emailsforis:unread label:support→ LLM draft → human_task →reply_to_email. - Lead alert — Webhook from a form →
send_emailto sales with submission details and CRM link. - Digest reports — Postgres or Sheets data → LLM summary →
send_emailon a schedule.
Tools
| Tool | Description |
|---|---|
send_email | Send an email through the connected Gmail account |
get_email | Retrieve a message by ID (from, to, subject, date, snippet) |
search_emails | Search with Gmail query syntax (e.g. from:user@example.com is:unread) |
reply_to_email | Reply to an existing message; supports reply-all |
Example
Send a notification after a workflow completes:Configuration
The instance inherits OAuth tokens from your Google connection. Optional config profile fields:| Key | Required | Default | Description |
|---|---|---|---|
user_id | No | me | Gmail user ID (me = authenticated account) |
sender_email | No | — | Default From address |
Gmail search syntax
search_emails accepts standard Gmail operators:
from:sender@example.comis:unreadsubject:invoiceafter:2026/01/01
from:alerts@example.com is:unread newer_than:7d
Troubleshooting
| Issue | Fix |
|---|---|
| Reconnect prompt on connection | Re-authorize Google OAuth; Gmail scopes may have been revoked |
403 from Gmail API | Confirm Gmail API is enabled and the account has send/read permissions |
| Empty search results | Verify query syntax; test the same query in Gmail’s web UI |