AgentSkillsCN

gmail

通过 FGP 守护进程实现 Gmail 的极速访问(速度比 MCP 快 10 倍)

SKILL.md
--- frontmatter
name: gmail
description: Fast Gmail access via FGP daemon (10x faster than MCP)
tools:
  - gmail.inbox
  - gmail.unread
  - gmail.search
  - gmail.send
  - gmail.thread

Gmail Skill

Fast Gmail integration via the FGP daemon. Provides 10x faster response times than MCP-based tools.

Available Methods

MethodDescription
gmail.inboxList recent emails from inbox
gmail.unreadGet unread count and summaries
gmail.searchSearch emails by query
gmail.sendSend an email
gmail.threadGet email thread by ID

Method Parameters

gmail.inbox

ParameterTypeRequiredDefaultDescription
limitintegerNo10Maximum emails to return (1-100)
bash
fgp call gmail.inbox -p '{"limit": 10}'

gmail.unread

No parameters. Returns unread count and first 10 unread email summaries.

bash
fgp call gmail.unread

gmail.search

ParameterTypeRequiredDefaultDescription
querystringYes-Gmail search query
limitintegerNo10Maximum emails to return
bash
fgp call gmail.search -p '{"query": "from:newsletter", "limit": 5}'

Search syntax examples:

  • from:sender@example.com - Filter by sender
  • to:recipient@example.com - Filter by recipient
  • subject:keyword - Filter by subject
  • is:unread - Only unread emails
  • after:2025/01/01 - After date
  • before:2025/12/31 - Before date
  • has:attachment - Has attachments
  • label:important - Has label

gmail.send

ParameterTypeRequiredDefaultDescription
tostringYes-Recipient email address
subjectstringYes-Email subject line
bodystringYes-Email body (plain text)
bash
fgp call gmail.send -p '{"to": "user@example.com", "subject": "Hello", "body": "Message body"}'

gmail.thread

ParameterTypeRequiredDefaultDescription
thread_idstringYes-Thread ID from inbox/search results
bash
fgp call gmail.thread -p '{"thread_id": "18abc123"}'

Response Schemas

Email Object

json
{
  "id": "18abc123",
  "thread_id": "18abc123",
  "from": "sender@example.com",
  "subject": "Meeting tomorrow",
  "date": "Mon, 13 Jan 2026 10:00:00 -0800",
  "snippet": "Just a reminder about our meeting..."
}

inbox/search Response

json
{
  "emails": [/* array of email objects */],
  "count": 10,
  "query": "from:newsletter"  // only for search
}

unread Response

json
{
  "unread_count": 5,
  "emails": [/* first 10 unread emails */]
}

send Response

json
{
  "sent": true,
  "message_id": "18abc456",
  "thread_id": "18abc123"
}

thread Response

json
{
  "thread_id": "18abc123",
  "messages": [/* array of messages with to/from */],
  "count": 3
}

Error Handling

ErrorCauseSolution
"Gmail API error: invalid_grant"OAuth token expiredRe-run OAuth flow
"Gmail API error: 403"Insufficient permissionsCheck OAuth scopes
"query parameter is required"Missing search queryAdd query parameter
"gmail-cli failed"Python script errorCheck Python 3 installed

Setup

  1. Get OAuth credentials:

    • Go to Google Cloud Console
    • Create a project and enable Gmail API
    • Create OAuth 2.0 credentials (Desktop application)
    • Download credentials.json
  2. Place credentials:

    bash
    mkdir -p ~/.fgp/auth/google
    mv credentials.json ~/.fgp/auth/google/
    
  3. Start daemon:

    bash
    fgp start gmail
    
  4. Authorize (first run only):

    • Browser opens for Google OAuth
    • Grant permissions
    • Token saved automatically

Troubleshooting

IssueCheckFix
Daemon not runningfgp status gmailfgp start gmail
Connection refusedSocket exists?fgp start gmail
OAuth expiredToken ageDelete token, restart
Python not foundpython3 --versionInstall Python 3
No credentials~/.fgp/auth/google/Add credentials.json

Logs location: ~/.fgp/services/gmail/logs/

Performance

MetricFGP GmailTraditional MCP
Cold start~50ms~300-500ms
Warm call~10-30msN/A (always cold)
Batch supportYesNo

Tips for best performance:

  • Keep daemon running (warm calls are fastest)
  • Use limit parameter to reduce payload size
  • Batch related queries when possible