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="user@example.com", 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.