Remote OpenClaw

Remote OpenClaw Blog

Gmail MCP Skill: Inbox Triage, Drafts, and Email Workflows

5 min read ·

Email remains the backbone of business communication, but managing it manually is a time sink. The Gmail MCP skill on OpenClaw Bazaar connects your OpenClaw agent to the Gmail API so it can triage your inbox, draft replies, search for messages, manage labels, and trigger workflows based on incoming emails -- all through natural conversation in your preferred messaging channel.

Why a Gmail Skill Matters

The average professional spends over two hours per day on email. Most of that time goes to sorting, reading low-priority messages, writing routine replies, and searching for specific threads. The Gmail MCP skill automates the repetitive parts while keeping you in control of what actually gets sent.

A critical safety feature: the skill defaults to draft mode. The agent creates email drafts that sit in your Drafts folder for review. You decide what gets sent. For specific automated workflows (like support auto-replies), you can explicitly enable auto-send, but draft mode is the recommended default.

What the Gmail Skill Can Do

  • Inbox summaries -- "What important emails came in overnight?" returns a prioritized digest
  • Draft replies -- "Draft a reply to the meeting invite from Alex accepting for Tuesday" creates the draft
  • Email search -- "Find the invoice from Acme Corp from last month" uses Gmail search operators
  • Label management -- auto-label incoming emails based on sender, subject, or content analysis
  • Email-to-task conversion -- emails from specific senders or matching specific criteria automatically create tasks in connected tools (Notion, GitHub, etc.)
  • Scheduled digests -- morning and evening email summaries delivered to your Slack or Discord channel

Setting Up Google Cloud Credentials

The Gmail skill authenticates through OAuth 2.0, which requires a Google Cloud project. This is a one-time setup.

Create the project. Go to console.cloud.google.com, create a new project, and enable the Gmail API under APIs & Services.

Configure OAuth consent. Under APIs & Services -> OAuth consent screen, select External user type. Fill in the app name and your email. Add the scope https://www.googleapis.com/auth/gmail.modify. Add your email as a test user (required until the app is verified).

Generate credentials. Go to Credentials -> Create Credentials -> OAuth client ID. Select Desktop app as the application type. Download the credentials.json file.

Authorize the connection. Run the authorization flow:

openclaw auth gmail --credentials /path/to/credentials.json

This opens a browser window. Sign in with the Gmail account you want to connect (we strongly recommend a dedicated account, not your personal one), approve the permissions, and the refresh token is stored locally.

Installing and Configuring the Skill

Find the Gmail skill in the OpenClaw Bazaar skills directory. After installing, configure it:

mcp_servers:
  gmail:
    credentials_path: "/path/to/credentials.json"
    token_path: "/path/to/token.json"
    default_mode: "draft"
    check_interval: 60
    labels_to_watch:
      - "INBOX"
    auto_label: true
    max_results: 20

Test with: "Summarize my last 5 emails." The agent should fetch and summarize your recent inbox contents.

Practical Email Workflows

Morning email briefing. At 7 AM, the agent checks overnight emails, categorizes them by priority (urgent, actionable, informational, low-priority), and sends a structured summary to your messaging channel. You scan the digest in 30 seconds instead of spending 20 minutes in your inbox.

Intelligent draft assistant. "Draft a polite decline to the cold sales email from VendorX" or "Draft a follow-up to the proposal I sent to TechFlow last week" generates contextually appropriate email drafts. The agent considers the original email thread, your typical writing style, and the relationship context.

Marketplace

Free skills and AI personas for OpenClaw — browse the marketplace.

Browse the Marketplace →

Follow-up tracking. "Remind me if Sarah has not replied to my proposal by Friday" sets a conditional check. If no reply arrives by Friday morning, the agent notifies you and optionally drafts a follow-up.

CRM synchronization. Combined with the Notion MCP skill, new emails from contacts automatically update your CRM database. An email from an existing lead triggers a note update. An email from an unknown address suggests creating a new lead entry.

Invoice processing. Emails with invoice attachments are automatically detected. The agent extracts key details (vendor, amount, due date, invoice number), summarizes them, and logs the information in a connected database or spreadsheet.

Context-aware auto-replies. For support inboxes, the agent can send auto-replies that actually contain useful information -- pulling from your knowledge base to answer common questions, confirming receipt with estimated response times, and routing complex issues to the right team member.

Security Best Practices

Use a dedicated Gmail account. Never connect your personal Gmail to an automation agent. Create a dedicated account, forward relevant emails to it, and restrict what the agent can access. This provides a clean audit trail and limits blast radius.

Keep draft mode as default. Only enable auto-send for workflows you have thoroughly tested. Even then, add safeguards: send limits per hour, recipient whitelists, and content review rules.

Monitor the audit log. The Gmail skill logs every API operation. Review these logs periodically to ensure the agent is behaving as expected.

Google Workspace accounts. The skill works with both personal Gmail and Google Workspace (business) accounts. For Workspace, your admin may need to approve the OAuth app or whitelist it in the Google Admin Console.

Troubleshooting Gmail Skill Issues

OAuth "access_denied" error. Your Google account must be added as a test user in the OAuth consent screen settings if the app is not yet verified. Go to Google Cloud Console -> OAuth consent screen -> Test users.

Token expired or revoked. Gmail refresh tokens can be invalidated by password changes or manual app removal in Google account settings. Re-run openclaw auth gmail to reauthorize.

Quota exceeded (429 errors). The Gmail API limits requests to 250 quota units per user per second. Increase check_interval or batch operations to stay within limits.

Drafts not appearing. Ensure the OAuth token has the gmail.modify scope, not just gmail.readonly. Draft creation requires write access.

Attachment processing issues. The agent can read PDFs, documents, spreadsheets, and images from email attachments. Processing quality depends on your configured LLM's multimodal capabilities. For best results with complex documents, ensure your agent uses a model with strong document understanding.

Browse the skills directory for the Gmail skill and related email automation tools that integrate with your complete workflow stack.


Browse the Skills Directory

Find the right skill for your workflow. The OpenClaw Bazaar skills directory has over 2,300 community-rated skills -- searchable, sortable, and free to install.

Browse Skills ->

Personas Include MCP Servers

OpenClaw personas come with pre-configured MCP server connections -- no manual setup needed. Pick a persona and the right servers are already wired in. Compare personas ->