PollyHub

Gmail Connector

Clean

Access Gmail with managed OAuth authentication to read, search, send, and manage emails using the Gmail API. Authentication is managed automatically via Polly's OAuth2 system with automatic token refresh.

SKILL.md

---
name: gmail-connector
description: >
  Access Gmail with managed OAuth authentication. Read, search, send, and manage emails.
  Use when the user wants to check emails, read messages, search Gmail, send emails, or manage their inbox.
  Keywords: gmail, email, inbox, send, search, google mail.
metadata:
  polly:
    polly_managed_connector: true
    auth:
      - env: GMAIL_ACCESS_TOKEN
        type: oauth2
        integration_id: google-mail
        description: Gmail account access
        scopes:
          - https://www.googleapis.com/auth/gmail.readonly
          - https://www.googleapis.com/auth/gmail.send
          - https://www.googleapis.com/auth/gmail.modify
    primaryEnv: GMAIL_ACCESS_TOKEN
---

# Gmail Connector

Access Gmail via the Gmail API using OAuth authentication managed by Polly.

---

## Authentication

This skill uses **Polly-managed OAuth2 authentication**. The access token is automatically managed and refreshed by Polly's auth system via the `GMAIL_ACCESS_TOKEN` environment variable.

**No manual token refresh is needed** — Polly handles token refresh automatically when needed.

On first use, if not connected, call:
```
manage_auth(action="connect", integration_id="google-mail", auth_env="GMAIL_ACCESS_TOKEN")
```

---

## Script

All commands use the gmail.py script:

```bash
python3 /home/polly/skills/installed/gmail-connector/scripts/gmail.py <command> [args]
```

---

## Commands

### List emails
```bash
python3 scripts/gmail.py list [limit]
```
Default limit: 10. Shows From, Subject, and Message ID.

### Read email
```bash
python3 scripts/gmail.py read <message_id>
```
Shows full email content including body.

### Send email
```bash
python3 scripts/gmail.py send <to_email> <subject> <body>
```

### Search emails
```bash
python3 scripts/gmail.py search <query> [limit]
```
Uses Gmail search syntax (e.g., "from:user@example.com", "subject:urgent").

---

## Notes

- Access tokens are **automatically refreshed by Polly's auth system**
- The LLM never directly accesses refresh tokens — they are managed securely by Polly
- The `GMAIL_ACCESS_TOKEN` environment variable is injected automatically when the skill runs
- Uses Gmail API v1
Authorstella
Downloads10
Versions4
Published2d ago
Auth Requirements
GMAIL_ACCESS_TOKENoauth2

integration: google-mail

Version History

v1.2.0latest

Updated with polly_managed_connector metadata flag, explicit Gmail API scopes, and removed connector-skill tag

Apr 9, 2026

Clean.zip
v1.1.1

Add polly_managed_connector flag and connector-skill tag

Apr 9, 2026

Clean.zip
v1.0.0

Initial release of v0.8 Tier 3 connectors

Apr 9, 2026

Clean.zip
v1.1.0

Nango OAuth with scopes in auth metadata

Apr 8, 2026

Clean.zip

SHA-256 (latest)

e38a00c461cca5bd09080a9b68b3027b367a0b71be23cf452e7939a138abb990