Gmail automation

From frank-luongt/faos-skills-marketplace · View interactive version

Gmail automation is an AI agent skill from the GitHub repository frank-luongt/faos-skills-marketplace. Automate Gmail tasks via Rube MCP (Composio): send/reply, search, labels, drafts, attachments. Always search tools first for current schemas.

How to use this skill

Skill file

<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT -->


name: gmail-automation

description: "Automate Gmail tasks via Rube MCP (Composio): send/reply, search, labels, drafts, attachments. Always search tools first for current schemas."


Gmail Automation via Rube MCP

Automate Gmail operations through Composio's Gmail toolkit via Rube MCP.

Prerequisites

Setup

Get Rube MCP: Add https://rube.app/mcp as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.

  1. Verify Rube MCP is available by confirming RUBE_SEARCH_TOOLS responds
  2. Call RUBE_MANAGE_CONNECTIONS with toolkit gmail
  3. If connection is not ACTIVE, follow the returned auth link to complete Google OAuth
  4. Confirm connection status shows ACTIVE before running any workflows

Core Workflows

1. Send an Email

When to use: User wants to compose and send a new email

Tool sequence:

  1. GMAIL_SEARCH_PEOPLE - Resolve contact name to email address [Optional]
  2. GMAIL_SEND_EMAIL - Send the email [Required]

Key parameters:

Pitfalls:

2. Reply to a Thread

When to use: User wants to reply to an existing email conversation

Tool sequence:

  1. GMAIL_FETCH_EMAILS - Find the email/thread to reply to [Prerequisite]
  2. GMAIL_REPLY_TO_THREAD - Send reply within the thread [Required]

Key parameters:

Pitfalls:

3. Search and Filter Emails

When to use: User wants to find specific emails by sender, subject, date, label, etc.

Tool sequence:

  1. GMAIL_FETCH_EMAILS - Search with Gmail query syntax [Required]
  2. GMAIL_FETCH_MESSAGE_BY_MESSAGE_ID - Get full message details for selected results [Optional]

Key parameters:

Pitfalls:

4. Manage Labels

When to use: User wants to create, modify, or organize labels

Tool sequence:

  1. GMAIL_LIST_LABELS - List all labels to find IDs and detect conflicts [Required]
  2. GMAIL_CREATE_LABEL - Create a new label [Optional]
  3. GMAIL_PATCH_LABEL - Rename or change label colors/visibility [Optional]
  4. GMAIL_DELETE_LABEL - Delete a user-created label (irreversible) [Optional]

Key parameters:

Pitfalls:

5. Apply/Remove Labels on Messages

When to use: User wants to label, archive, or mark emails as read/unread

Tool sequence:

  1. GMAIL_LIST_LABELS - Get label IDs for custom labels [Prerequisite]
  2. GMAIL_FETCH_EMAILS - Find target messages [Prerequisite]
  3. GMAIL_BATCH_MODIFY_MESSAGES - Bulk add/remove labels (up to 1000 messages) [Required]
  4. GMAIL_ADD_LABEL_TO_EMAIL - Single-message label changes [Fallback]

Key parameters:

Pitfalls:

6. Handle Drafts and Attachments

When to use: User wants to create, edit, or send email drafts, possibly with attachments

Tool sequence:

  1. GMAIL_CREATE_EMAIL_DRAFT - Create a new draft [Required]
  2. GMAIL_UPDATE_DRAFT - Edit draft content [Optional]
  3. GMAIL_LIST_DRAFTS - List existing drafts [Optional]
  4. GMAIL_SEND_DRAFT - Send a draft (requires explicit user approval) [Optional]
  5. GMAIL_GET_ATTACHMENT - Download attachment from existing message [Optional]

Key parameters:

Pitfalls:

Common Patterns

ID Resolution

Label name → Label ID:

1. Call GMAIL_LIST_LABELS
2. Find label by name in response
3. Extract id field (e.g., 'Label_123')

Contact name → Email:

1. Call GMAIL_SEARCH_PEOPLE with query=contact_name
2. Extract emailAddresses from response

Thread ID from search:

1. Call GMAIL_FETCH_EMAILS or GMAIL_LIST_THREADS
2. Extract threadId (15-16 char hex string)

Pagination

Gmail Query Syntax

Operators:

Combinators:

Examples:

Known Pitfalls

ID Formats:

Query Syntax:

Rate Limits:

Response Parsing:

Attachments:

Quick Reference

| Task | Tool Slug | Key Params |

|------|-----------|------------|

| Send email | GMAIL_SEND_EMAIL | recipient_email, subject, body, is_html |

| Reply to thread | GMAIL_REPLY_TO_THREAD | thread_id, message_body, recipient_email |

| Search emails | GMAIL_FETCH_EMAILS | query, max_results, label_ids, page_token |

| Get message details | GMAIL_FETCH_MESSAGE_BY_MESSAGE_ID | message_id |

| List labels | GMAIL_LIST_LABELS | (none) |

| Create label | GMAIL_CREATE_LABEL | label_name, background_color, text_color |

| Modify labels bulk | GMAIL_BATCH_MODIFY_MESSAGES | messageIds, addLabelIds, removeLabelIds |

| Create draft | GMAIL_CREATE_EMAIL_DRAFT | recipient_email, subject, body, thread_id |

| Send draft | GMAIL_SEND_DRAFT | draft_id |

| Get attachment | GMAIL_GET_ATTACHMENT | message_id, attachment_id |

| Search contacts | GMAIL_SEARCH_PEOPLE | query |

| Get profile | GMAIL_GET_PROFILE | (none) |

<!-- Source: .faos/custom/skills/devops/gmail-automation/SKILL.md -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.