gmail

odyssey4me/agent-skills · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/odyssey4me/agent-skills --skill gmail
0 commentsdiscussion
summary

Interact with Gmail for email management, search, and organization.

skill.md

Gmail

Interact with Gmail for email management, search, and organization.

Installation

Dependencies: pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyaml

Setup Verification

After installation, verify the skill is properly configured:

$SKILL_DIR/scripts/gmail.py check

This will check:

  • Python dependencies (google-auth, google-auth-oauthlib, google-api-python-client, keyring, pyyaml)
  • Authentication configuration
  • Connectivity to Gmail API

If anything is missing, the check command will provide setup instructions.

Authentication

Gmail uses OAuth 2.0 for authentication. For complete setup instructions, see:

  1. GCP Project Setup Guide - Create project, enable Gmail API
  2. Google OAuth Setup Guide - Configure credentials

Quick Start

  1. Create ~/.config/agent-skills/google.yaml:

    oauth_client:
      client_id: your-client-id.apps.googleusercontent.com
      client_secret: your-client-secret
    
  2. Run $SKILL_DIR/scripts/gmail.py check to trigger OAuth flow and verify setup.

On scope or authentication errors, see the OAuth troubleshooting guide.

Commands

See permissions.md for read/write classification of each command.

check

Verify configuration and connectivity.

$SKILL_DIR/scripts/gmail.py check

This validates:

  • Python dependencies are installed
  • Authentication is configured
  • Can connect to Gmail API
  • Displays your email address and mailbox statistics

auth setup

Store OAuth 2.0 client credentials for custom OAuth flow.

$SKILL_DIR/scripts/gmail.py auth setup \
  --client-id YOUR_CLIENT_ID \
  --client-secret YOUR_CLIENT_SECRET

Credentials are saved to ~/.config/agent-skills/gmail.yaml.

auth reset

Clear stored OAuth token. The next command that needs authentication will trigger re-authentication automatically.

$SKILL_DIR/scripts/gmail.py auth reset

Use this when you encounter scope or authentication errors.

auth status

Show current OAuth token information without making API calls.

$SKILL_DIR/scripts/gmail.py auth status

Displays: whether a token is stored, granted scopes, refresh token presence, token expiry, and client ID.

messages list

List messages matching a query.

# List recent messages
$SKILL_DIR/scripts/gmail.py messages list

# Search for unread messages
$SKILL_DIR/scripts/gmail.py messages list --query "is:unread"

# Search with max results
$SKILL_DIR/scripts/gmail.py messages list --query "from:[email protected]" --max-results 20

Arguments:

  • --query: Gmail search query (optional)
  • --max-results: Maximum number of results (default: 10)

Search Query Examples:

For complete Gmail search syntax, see gmail-queries.md.

Common queries:

  • is:unread - Unread messages
  • from:[email protected] - Messages from sender
  • subject:meeting - Messages with subject keyword
  • has:attachment - Messages with attachments
  • after:2024/01/01 - Messages after date
  • label:important - Messages with label

messages get

Get a message by ID.

# Get full message
$SKILL_DIR/scripts/gmail.py messages get MESSAGE_ID

# Get minimal format
$SKILL_DIR/scripts/gmail.py messages get MESSAGE_ID --format minimal

Arguments:

  • message_id: The message ID (required)
  • --format: Message format (full, minimal, raw, metadata) - default: full

send

Send an email message.

# Send simple email
$SKILL_DIR/scripts/gmail.py send \
  --to [email protected] \
  --subject "Hello" \
  --body "This is the message body"

# Send with CC and BCC
$SKILL_DIR/scripts/gmail.py send \
  --to [email protected] \
  --subject "Team Update" \
  --body "Here's the update..." \
  --cc [email protected] \
  --bcc [email protected]

Arguments:

  • --to: Recipient email address (required)
  • --subject: Email subject (required)
  • --body: Email body text (required)
  • --cc: CC recipients (comma-separated)
  • --bcc: BCC recipients (comma-separated)

drafts list

List draft messages.

# List drafts
$SKILL_DIR/scripts/gmail.py drafts list

# List with custom max results
$SKILL_DIR/scripts/gmail.py drafts list --max-results 20

Arguments:

  • --max-results: Maximum number of results (default: 10)

drafts create

Create a draft email.

# Create draft
$SKILL_DIR/scripts/gmail.py drafts create \
  --to [email protected] \
  --subject "Draft Subject" \
  --body "This is a draft message"

# Create draft with CC
$SKILL_DIR/scripts/gmail.py drafts create \
  --to [email protected] \
  --subject "Meeting Notes" \
  --body "Notes from today's meeting..." \
  --cc [email protected]

Arguments:

  • --to: Recipient email address (required)
  • --subject: Email subject (required)
  • --body: Email body text (required)
  • --cc: CC recipients (comma-separated)
  • --bcc: BCC recipients (comma-separated)

drafts send

Send a draft message.

# Send draft by ID
$SKILL_DIR/scripts/gmail.py drafts send DRAFT_ID

Arguments:

  • draft_id: The draft ID to send (required)

labels list

List all Gmail labels.

# List labels
$SKILL_DIR/scripts/gmail.py labels list

labels create

Create a new label.

# Create label
$SKILL_DIR/scripts/gmail.py labels create "Project X"

Arguments:

  • name: Label name (required)

Examples

Verify Setup

$SKILL_DIR/scripts/gmail.py check

Find unread emails

$SKILL_DIR/scripts/gmail.py messages list --query "is:unread"

Search for emails from a sender

$SKILL_DIR/scripts/gmail.py messages list --query "from:[email protected]" --max-results 5

Send a quick email

$SKILL_DIR/scripts/gmail.py send \
  --to [email protected] \
  --subject "Quick Question" \
  --body "Do you have time for a meeting tomorrow?"

Create and send a draft

# Create draft
$SKILL_DIR/scripts/gmail.py drafts create \
  --to [email protected] \
  --subject "Weekly Update" \
  --body "Here's this week's update..."

# List drafts to get the ID
$SKILL_DIR/scripts/gmail.py drafts list

# Send the draft
$SKILL_DIR/scripts/gmail.py drafts send DRAFT_ID

Organize with labels

# Create a label
$SKILL_DIR/scripts/gmail.py labels create "Project Alpha"

# List all labels
$SKILL_DIR/scripts/gmail.py labels list

Advanced searches

# Find emails with attachments from last week
$SKILL_DIR/scripts/gmail.py messages list --query "has:attachment newer_than:7d"

# Find important emails from specific sender
$SKILL_DIR/scripts/gmail.py messages list --query "from:[email protected] is:important"

# Find emails in a conversation
$SKILL_DIR/scripts/gmail.py messages list --query "subject:project-alpha"

Gmail Search Query Syntax

Common search operators:

Operator Description Example
from: Sender email from:[email protected]
to: Recipient email to:[email protected]
subject: Subject contains subject:meeting
label: Has label label:important
has:attachment Has attachment has:attachment
is:unread Unread messages is:unread
is:starred Starred messages is:starred
after: After date after:2024/01/01
before: Before date before:2024/12/31
newer_than: Newer than period newer_than:7d
older_than: Older than period older_than:30d

Combine operators with spaces (implicit AND) or OR:

# AND (implicit)
from:[email protected] subject:meeting

# OR
from:[email protected] OR from:[email protected]

# Grouping with parentheses
(from:[email protected] OR from:[email protected]) subject:meeting

For the complete reference, see gmail-queries.md.

Error Handling

Authentication and scope errors are not retryable. If a command fails with an authentication error, insufficient scope error, or permission denied error (exit code 1), stop and inform the user. Do not retry or attempt to fix the issue autonomously — these errors require user interaction (browser-based OAuth consent). Point the user to the OAuth troubleshooting guide.

Retryable errors: Rate limiting (HTTP 429) and temporary server errors (HTTP 5xx) may succeed on retry after a brief wait. All other errors should be reported to the user.

Model Guidance

This skill makes API calls requiring structured input/output. A standard-capability model is recommended.

how to use gmail

How to use gmail on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add gmail
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/odyssey4me/agent-skills --skill gmail

The skills CLI fetches gmail from GitHub repository odyssey4me/agent-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/gmail

Reload or restart Cursor to activate gmail. Access the skill through slash commands (e.g., /gmail) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.648 reviews
  • Hana Choi· Dec 24, 2024

    Solid pick for teams standardizing on skills: gmail is focused, and the summary matches what you get after install.

  • Diya Wang· Dec 16, 2024

    gmail has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Hana Singh· Dec 4, 2024

    Keeps context tight: gmail is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Charlotte Taylor· Dec 4, 2024

    gmail reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Mei Bhatia· Nov 23, 2024

    gmail is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Aanya Farah· Nov 23, 2024

    gmail has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Carlos Verma· Nov 11, 2024

    We added gmail from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Alexander Thompson· Nov 7, 2024

    gmail reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Alexander Sanchez· Oct 26, 2024

    I recommend gmail for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Soo Bhatia· Oct 14, 2024

    gmail fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

showing 1-10 of 48

1 / 5