Gmail for Openclaw

A comprehensive Gmail API integration for AI agents that provides managed OAuth authentication to read, send, and organize emails and threads.

bobbyzzhao
v1.0.0
Feb 24, 2026
0
1.4k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install gmail-1-0-6

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install gmail-1-0-6 using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Gmail?

The Gmail skill is a specialized integration designed to bridge the gap between AI coding agents and the Google Mail ecosystem. By leveraging a managed OAuth gateway, this tool allows Openclaw Skills to perform complex email operations—such as retrieving message threads, modifying labels, and sending drafts—without requiring the developer to manage complex token refresh logic manually. It serves as a critical component for building sophisticated communication workflows within the Openclaw Skills framework.

Built with developer productivity in mind, this skill abstracts the native Google REST API into a predictable gateway. Whether you are building an automated support agent or a personal assistant, the Gmail integration ensures that your AI has secure, authenticated access to mailbox data while maintaining high performance and reliability.

Gmail Use Cases

  • Automating the triaging of unread emails by applying specific labels based on content.
  • Building AI assistants that can draft, review, and send professional replies directly from the terminal.
  • Monitoring specific senders or subjects to trigger downstream automated workflows in Openclaw Skills.
  • Extracting data from attachments or message bodies for automated reporting and data analysis.

How Gmail Works

  1. The AI agent initiates a request using the Maton API key for authentication via the Openclaw Skills environment.
  2. The request is routed to the Maton gateway which automatically injects the necessary OAuth tokens for the specific Gmail account.
  3. The gateway proxies the request to the official Gmail API endpoints (e.g., users.messages or users.threads).
  4. Gmail processes the request (listing, getting, or sending) and returns a JSON response.
  5. The gateway passes the structured data back to the agent, handling any necessary encoding or decoding such as base64url for raw email content.

Gmail Setup

To get started with this skill in your Openclaw Skills environment, follow these steps:

  1. Sign in at maton.ai and retrieve your API key from the settings page.
  2. Set your environment variable:
export MATON_API_KEY="YOUR_API_KEY"
  1. Create a new Google Mail connection:
# Example using Python to create a connection
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'google-mail'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
  1. Open the returned URL in your browser to complete the Google OAuth process.

Gmail Data Schema & Taxonomy

The Gmail skill utilizes standard Google Mail resource structures. Below is how the data is organized for Openclaw Skills users:

Resource Description Key Fields
Messages Individual email records id, threadId, labelIds, snippet, raw
Threads Grouped conversations id, historyId, messages
Labels Inbox organization tags id, name, type, messagesTotal
Drafts Unsent email messages id, message

All raw email content is base64url encoded to ensure safe transmission of multi-part data.

Gmail Advanced Features

  • Multi-account management: Specify a unique connection ID using the Maton-Connection header to switch between different Gmail accounts within the same Openclaw Skills workflow.
  • Advanced Filtering: Full support for Gmail query operators like is:unread, has:attachment, and after:YYYY/MM/DD.
  • Managed OAuth: Automatic token refreshing and lifecycle management handled by the gateway.
  • Bulk Operations: Ability to modify labels (add/remove) across multiple messages to facilitate automated inbox cleaning.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*