Access Gmail via the Gmail API with OAuth authentication. Read, search, draft, reply to, and organize Gmail from chat.
This skill uses ClawLink for hosted connection flows and credentials so you do not need to configure Gmail API access yourself.
Step 1: InstallStep 2: Pair AccountStep 3: Connect Gmail
_App-specific connection GIF coming soon_Run the install command in OpenClawSign in and approve the deviceOpen the dashboard and connect Gmail
text
┌─────────────────┐ ┌──────────────┐ ┌──────────────────┐
│ OpenClaw │────▶│ ClawLink │────▶│ Gmail API │
│ (User Chat) │ │ (OAuth) │ │ (REST) │
└─────────────────┘ └──────────────┘ └──────────────────┘
│ │ │
│ 1. Install Plugin │ │
│ 2. Pair Device │ │
│ 3. Connect Gmail │ │
│ │ 4. Secure Token │
│ │ 5. Proxy Requests │
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ SKILL │ │ Dashboard│ │ Gmail │
│ File │ │ Auth │ │ Inbox │
└──────────┘ └──────────┘ └──────────┘
Install the verified ClawLink plugin from ClawHub. After the user confirms, complete the full setup so ClawLink tools are visible in the next OpenClaw chat.
bash
openclaw plugins install clawhub:clawlink-plugin
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart
Then tell the user: "OpenClaw has been restarted. Send /new as a standalone message to start a fresh chat, then ask for Gmail again."
bash
# Get Gmail profile (confirms connection and shows email)
clawlink_call_tool --tool "gmail_get_profile" --params '{}'
# List recent emails
clawlink_call_tool --tool "gmail_fetch_emails" --params '{"max_results": 10}'
# Search emails
clawlink_call_tool --tool "gmail_fetch_emails" --params '{"query": "from:boss@example.com subject:report"}'
All Gmail tool calls are authenticated automatically by ClawLink using the user's connected Google account.
No API key is required in chat. ClawLink stores the OAuth token securely and injects it into every Gmail API request on the user's behalf.
clawlink_begin_pairing if it is not configured yet.clawlink_list_integrations to verify the connection is active.bash
clawlink_list_integrations
Response: Returns all connected integrations. Look for gmail in the list.
bash
clawlink_list_tools --integration gmail
Response: Returns the live tool catalog for Gmail.
If Gmail tools are missing or the connection shows an error:
clawlink_list_integrations to verifyclawlink_list_tools --integration gmailhttps://www.googleapis.com/auth/mail.google.com scope), which is what read, search, draft, send, forward, and label operations require. The user can revoke it at any time at https://myaccount.google.com/permissions.ToolDescriptionModegmail_fetch_emailsSearch and fetch emails with filtering and paginationReadgmail_fetch_message_by_message_idGet a specific email by message IDReadgmail_fetch_message_by_thread_idGet all messages in a threadReadgmail_get_attachmentDownload an email attachmentRead
ToolDescriptionModegmail_send_emailSend an email immediatelyWritegmail_reply_to_threadReply to an existing email threadWritegmail_forward_messageForward an email to specified recipientsWritegmail_create_email_draftCreate a draft emailWritegmail_update_draftUpdate an existing draftWritegmail_send_draftSend an existing draftWrite
ToolDescriptionModegmail_list_labelsList all labels (system and custom)Readgmail_get_labelGet details for a specific labelReadgmail_create_labelCreate a new custom labelWritegmail_update_labelUpdate label name or colorWritegmail_delete_labelDelete a custom labelWritegmail_add_label_to_emailAdd or remove labels from a messageWrite
ToolDescriptionModegmail_list_threadsList email threadsReadgmail_modify_thread_labelsAdd or remove labels from a threadWritegmail_move_thread_to_trashMove a thread to trashWritegmail_move_to_trashMove a single message to trashWritegmail_untrash_messageRestore a message from trashWritegmail_untrash_threadRestore a thread from trashWrite
ToolDescriptionModegmail_batch_modify_messagesModify labels on up to 1,000 messagesWritegmail_batch_delete_messagesPermanently delete multiple messagesWrite
ToolDescriptionModegmail_get_profileGet Gmail profile (email, message/thread counts)Readgmail_list_send_asList send-as aliasesReadgmail_list_draftsList all draftsRead
ToolDescriptionModegmail_list_filtersList all email filtersReadgmail_create_filterCreate a new filter ruleWrite
ToolDescriptionModegmail_get_contactsList contactsReadgmail_search_peopleSearch contacts by name, email, phoneRead
bash
clawlink_call_tool --tool "gmail_fetch_emails" \
--params '{
"query": "from:boss@example.com",
"max_results": 20
}'
bash
clawlink_call_tool --tool "gmail_send_email" \
--params '{
"to": ["recipient@example.com"],
"subject": "Weekly Report",
"body": "Please find the weekly report attached.",
"is_html": false
}'
bash
clawlink_call_tool --tool "gmail_reply_to_thread" \
--params '{
"thread_id": "thread-id-here",
"body": "Thank you for the update. I will review and get back to you shortly.",
"incoming": false
}'
bash
clawlink_call_tool --tool "gmail_create_email_draft" \
--params '{
"to": ["team@example.com"],
"subject": "Meeting Notes",
"body": "Here are the notes from todays meeting...",
"is_html": false
}'
bash
clawlink_call_tool --tool "gmail_add_label_to_email" \
--params '{
"message_id": "message-id-here",
"label_ids": ["Label_123"]
}'
clawlink_list_integrations to confirm Gmail is connected.clawlink_list_tools --integration gmail to see the live catalog.clawlink_search_tools with a short query and integration gmail.text
┌─────────────────────────────────────────────────────────────┐
│ READ OPERATIONS (Safe) │
│ search → fetch → get → list → call │
│ │
│ Example: Search emails → Fetch thread → Show messages │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ WRITE OPERATIONS (Require Confirmation) │
│ describe → preview → confirm → send/draft/label/trash │
│ │
│ Example: Preview email → User confirms → Execute send │
└─────────────────────────────────────────────────────────────┘
clawlink_describe_tool first.whenToUse, askBefore, safeDefaults, examples, and followups to shape the call.clawlink_preview_tool first, then confirm with the user.clawlink_call_tool. Pass confirmation only after the preview matches the user's intent.Label_123) are required for label operations — display names cannot be used.thread_id is required for replies. Leave subject empty when replying to stay in the same thread.gmail_fetch_emails defaults max_results to 1. A request like "check my unread email" returns a single message unless you set it explicitly. Always pass a real number when the user asks for more than one.query argument, same as the Gmail search box: from:, to:, subject:, label:, is:unread, has:attachment, in:inbox, newer_than:7d, older_than:1m, after:, before:. Combine them freely ( from:stripe.com has:attachment newer_than:30d).include_spam_trash is set. If a message the user insists exists cannot be found, check there before reporting it missing.label_ids filters on label IDs, not display names. Built-ins are uppercase ( INBOX, UNREAD, STARRED, SPAM, TRASH); call gmail_list_labels first for custom ones.Status / ErrorMeaningTool not foundThe tool name does not exist in the current catalog. Verify with clawlink_list_tools --integration gmail.Missing connectionGmail is not connected. Direct the user to https://claw-link.dev/dashboard?add=gmail.404 Not FoundMessage or thread ID does not exist or is not accessible.403 ForbiddenMost often a placeholder or example ID rather than a scope problem: an ID copied from documentation instead of one returned by a live search. Run a list or search call first, then retry with a real message_id, thread_id, or label ID. Otherwise it is Gmail API quota, or the connected account lacking access to the mailbox in the request.Worked before, now failing on every callThe OAuth token was invalidated. Google does this when the user changes their Google account password (refresh tokens carrying Gmail scopes are revoked), when they revoke the app's access, or after six months of non-use. Direct the user to reconnect at https://claw-link.dev/dashboard?add=gmail.429 Rate LimitToo many requests. Apply exponential backoff.Write rejectedUser did not confirm a write action. Always confirm before executing sends, replies, forwards, drafts, label changes, archive, or delete.
Check that the ClawLink plugin is installed: bash
openclaw plugins list
If the plugin is installed but tools are missing, tell the user to send /new as a standalone message to reload the catalog.
If a fresh chat does not help, run: bash
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart
After restart, tell the user to send /new again and retry.
gmail.clawlink_describe_tool to verify parameter names and types before calling.clawlink_preview_tool first.Powered by ClawLink — an integration hub for OpenClaw
