Agent skill
gmail
Comprehensive guide for using Gmail tools to send emails, manage drafts, and handle attachments. Use when the user asks to send emails, check inbox, search contacts, or manage labels.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/gmail
SKILL.md
Gmail Skill
This skill provides best practices and workflows for using the Gmail toolkit effectively.
Core Capabilities
- Sending Emails:
GMAIL_SEND_EMAIL - Draft Management:
GMAIL_CREATE_EMAIL_DRAFT,GMAIL_SEND_DRAFT - Inbox Management:
GMAIL_FETCH_EMAILS,GMAIL_LIST_THREADS - Label Management:
GMAIL_CREATE_LABEL,GMAIL_ADD_LABEL_TO_EMAIL
Critical Usage Guidelines
1. Handling Attachments (IMPORTANT)
The GMAIL_SEND_EMAIL tool definition can be ambiguous regarding attachments.
- Single File: Use the
attachmentparameter (object withs3key,name,mimetype). - Multiple Files:
- Preferred: Look for an
attachments(plural) parameter if available in the tool definition. - Fallback: If
attachmentsis not available, you CANNOT pass a list to the singularattachmentfield. You must zip the files into a single archive and send that as the singleattachment. - Constraint: Do NOT send multiple separate emails just to send multiple attachments unless explicitly requested.
- Preferred: Look for an
2. Sending HTML Emails
- Always set
is_html=Trueif yourbodycontains any HTML tags (e.g.,<b>,<br>,<ul>). - If
is_html=False(default), the body will be rendered as plain text, showing the raw HTML tags to the recipient.
3. Drafts First Policy (Best Practice)
For critical or sensitive emails, prefer creating a draft first (GMAIL_CREATE_EMAIL_DRAFT) and asking the user to confirm/send it, rather than sending immediately with GMAIL_SEND_EMAIL, unless the user explicitly said "send this email".
Common Workflows
Sending a Report
- Generate Content: Create the file (e.g., PDF report).
- Verify Files: Ensure the file exists and you have the path.
- Send:
json
// 1) Upload the local file to Composio for attachment mcp__internal__upload_to_composio({ "path": "/path/to/report.pdf", "tool_slug": "GMAIL_SEND_EMAIL", "toolkit_slug": "gmail" }) // 2) Use the returned s3key in the email attachment GMAIL_SEND_EMAIL( recipient_email="[email protected]", subject="Weekly Report", body="Here is your report.", attachment={ "s3key": "<from upload_to_composio>", "name": "report.pdf", "mimetype": "application/pdf" } )- Use
mcp__internal__upload_to_composiofor attachment uploads.
- Use
Responding to a Thread
- Find Thread: Use
GMAIL_LIST_THREADSorGMAIL_FETCH_EMAILSto find the context. - Get ID: Extract the
thread_id. - Reply: Use
GMAIL_REPLY_TO_THREADwith thethread_idto ensure the email threads correctly in the recipient's inbox.
Troubleshooting
- "Attachment Error": If sending fails with an attachment error, verify you aren't passing a list to a singular field.
- "Authentication Error": Ensure the
user_idis set to 'me' or the correct email address. - "Composio SDK Error": Do NOT call
from composio import ...in Bash/Python. Always use the MCP tools.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?