gmail

gmail is a skill for Claude Code, Codex from samttoo22-MewCat/OpenSoul. It costs 51 tokens per session (941 once invoked), scanned A, original, MIT.

A Gmail connector that lets an agent read recent messages through Google's secure sign-in system. It can retrieve message content and mark messages as read.

In plain words
What is it for?
Use it to check recent email, extract message details, and update messages after reading them.
Why use it?
It removes the need to open Gmail and copy messages manually. It also avoids storing a Gmail password in the tool.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to check recent email, extract message details, and update messages after reading them.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/samttoo22-mewcat/opensoul/gmail
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add samttoo22-MewCat/OpenSoul --skill gmail
Clone the repo
git clone --depth 1 https://github.com/samttoo22-MewCat/OpenSoul

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gmail

README.md
[![agentmods](https://agentmods.dev/badge/skills/samttoo22-mewcat/opensoul/gmail.svg)](https://agentmods.dev/skills/samttoo22-mewcat/opensoul/gmail)
Your own site
<a href="https://agentmods.dev/skills/samttoo22-mewcat/opensoul/gmail"><img src="https://agentmods.dev/badge/skills/samttoo22-mewcat/opensoul/gmail.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 941 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.00941
Opus 5 $0.00026 $0.00470
Sonnet 5 $0.00010 $0.00188
Haiku 4.5 $0.00005 $0.00094

Measured 8d ago against content hash bd5fdfaad095, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

gmail scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/gmail_controller.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

openclaw/skills/gmail/SKILL.md · 100 lines

What it actually says

Gmail Integration (OAuth2 API)

此技能允許透過 Google OAuth2 安全地存取 Gmail 帳戶,讀取信件並進行郵件操作。無需應用密碼,使用標準 OAuth2 流程。

核心功能

  1. OAuth2 認證:首次使用時彈出瀏覽器進行授權
  2. 信件檢索:查詢最近 3 天內的信件(已讀和未讀均獲取)
  3. 自動標記:讀取後自動標記為已讀
  4. 多語言支援:支援 UTF-8, Big5, GBK 等多種編碼
  5. 快取機制:自動快取最多 50 封信件到本地 JSON
  6. 默認限制:每次查詢返回最新 20 封郵件

使用方法

透過執行 scripts/gmail_controller.py 來操作。

1. 初始化並檢索信件

# 默認獲取最新 20 個郵件(已讀和未讀)
python scripts/gmail_controller.py --action fetch

# 或指定數量
python scripts/gmail_controller.py --action fetch --limit 10

輸出:

{
  "status": "success",
  "new_count": 5,
  "cached_count": 20,
  "newest": "2026-03-06T10:30:45",
  "oldest": "2026-03-01T09:15:00",
  "emails": [
    {
      "id": "msg_123",
      "from": "[email protected]",
      "subject": "郵件主旨",
      "date": "Mon, 6 Mar 2026 10:30:45 +0000",
      "preview": "前 500 字內容..."
    }
  ]
}

2. 獲取快取統計

python scripts/gmail_controller.py --action stats

必要條件

  1. Google Cloud 專案 - 有效的 OAuth2 認證
  2. credentials.json - 保存到 workspace/credentials.json
  3. 首次認證 - 執行 fetch 時如無 token.json,會自動彈出瀏覽器授權

認證流程

首次執行

1. 檢查 credentials.json
2. 若無 token.json,彈出瀏覽器
3. 用戶在 Google 登入頁授予「修改郵件」權限
4. Token 自動保存到 workspace/token.json
5. 後續執行自動使用 token(無需再授權)

Token 自動刷新

  • 當 token 過期時,系統自動使用 refresh_token 刷新
  • 無需人工干預

設定檔

必要: workspace/credentials.json (來自 Google Cloud Console)

可選: .env

GMAIL_CHECK_INTERVAL_MINUTES=5    # Polling 間隔(若在 Dream Engine 中使用)

注意事項

  • 權限:使用 gmail.modify scope(讀取及標記信件)
  • 查詢範圍:固定查詢最近 3 天的信件(優化 API 配額)
  • 快取限制:最多保留 50 封,新信自動插入開頭
  • 字符編碼:自動偵測並支援多種編碼(UTF-8, Big5, GBK 等)

安全特性

  • ✅ 使用 Google OAuth2(無密碼存儲)
  • ✅ Token 自動加密保存
  • ✅ 支援 Token 自動刷新
  • ✅ 不支援刪除郵件(只能讀取和標記)
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 100 lines · 51 tokens per session scan A bd5fdfaad095

Subscribe to this mod's changes

gmail is a skill published in the GitHub repository samttoo22-MewCat/OpenSoul (19 stars, last pushed 5mo ago), licensed MIT. It adds 51 tokens to every session and 941 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.