Gmail - All Email Actions
Complete Gmail management: send, reply, forward, search, read, trash, label, and draft emails.
Actions
send_message
Send a new email.
Required: to (array of email addresses), subject, body_text or body_html
Optional: cc, bcc, from_email (requires send-as alias configured in Gmail), body_html, attachments, thread_id
{
"action": "send_message",
"to": ["recipient@example.com"],
"subject": "Project Update",
"body_text": "Hi, here is the latest update on the project.",
"cc": ["manager@example.com"]
}
With attachment:
{
"action": "send_message",
"to": ["team@example.com"],
"subject": "Monthly Report",
"body_text": "Please find the report attached.",
"attachments": [
{
"filename": "report.pdf",
"file_url": "https://example.com/files/report.pdf",
"content_type": "application/pdf"
}
]
}
reply_message
Reply to an existing email. The reply stays in the same thread and automatically uses the original subject and recipient.
Required: message_id, body_text or body_html
Optional: cc, bcc, attachments
{
"action": "reply_message",
"message_id": "18a1b2c3d4e5f6g7",
"body_text": "Thanks for the update. I'll review this by Friday."
}
forward_message
Forward an email to new recipients. The original message content is included automatically.
Required: message_id, to
Optional: body_text (added above the forwarded content), cc, bcc, attachments
{
"action": "forward_message",
"message_id": "18a1b2c3d4e5f6g7",
"to": ["colleague@example.com"],
"body_text": "FYI - see the message below."
}
list_messages
Search and list emails. Returns message IDs and thread IDs. Use get_message to read full content.
Required: none
Optional: q (Gmail search query), max_results (1-500, default 20), label_ids, page_token
{
"action": "list_messages",
"q": "is:unread from:boss@example.com",
"max_results": 10
}
Common search queries:
is:unread - unread messages
from:user@example.com - from a specific sender
subject:meeting - subject contains "meeting"
has:attachment - messages with attachments
newer_than:7d - from the last 7 days
older_than:30d - older than 30 days
in:sent - sent messages
label:work - messages with a specific label
get_message
Read the full content of an email including headers, body, and attachment metadata.
Required: message_id
Optional: format - full (default, headers + body), metadata (headers only), minimal (IDs only)
{
"action": "get_message",
"message_id": "18a1b2c3d4e5f6g7",
"format": "full"
}
trash_message
Move an email to the trash.
Required: message_id
{
"action": "trash_message",
"message_id": "18a1b2c3d4e5f6g7"
}
untrash_message
Restore an email from the trash back to its original location.
Required: message_id
{
"action": "untrash_message",
"message_id": "18a1b2c3d4e5f6g7"
}
modify_labels
Add or remove labels from an email. Use list_labels first to find available label IDs.
Required: message_id, at least one of add_label_ids or remove_label_ids
{
"action": "modify_labels",
"message_id": "18a1b2c3d4e5f6g7",
"add_label_ids": ["STARRED"],
"remove_label_ids": ["UNREAD"]
}
Common label IDs: INBOX, SENT, TRASH, DRAFT, SPAM, STARRED, IMPORTANT, UNREAD, CATEGORY_PERSONAL, CATEGORY_SOCIAL, CATEGORY_PROMOTIONS
Useful patterns:
- Mark as read:
remove_label_ids: ["UNREAD"]
- Mark as unread:
add_label_ids: ["UNREAD"]
- Archive:
remove_label_ids: ["INBOX"]
- Star:
add_label_ids: ["STARRED"]
list_labels
Get all available labels (system and user-created).
Required: none
{
"action": "list_labels"
}
create_draft
Create a draft email that can be edited or sent later.
Required: to, subject, body_text or body_html
Optional: cc, bcc, from_email, body_html, attachments, thread_id
{
"action": "create_draft",
"to": ["client@example.com"],
"subject": "Proposal Draft",
"body_html": "<h1>Proposal</h1><p>Here are the details...</p>"
}
send_draft
Send a previously created draft.
Required: draft_id
{
"action": "send_draft",
"draft_id": "r123456789"
}
get_draft
Retrieve the content of a draft.
Required: draft_id
Optional: format - full (default), metadata, minimal
{
"action": "get_draft",
"draft_id": "r123456789"
}
delete_draft
Permanently delete a draft.
Required: draft_id
{
"action": "delete_draft",
"draft_id": "r123456789"
}
get_profile
Get the authenticated user's Gmail profile including email address and message counts.
Required: none
{
"action": "get_profile"
}
Common Workflows
Check and read unread emails:
list_messages with q: "is:unread" to get message IDs
get_message for each message ID to read content
modify_labels with remove_label_ids: ["UNREAD"] to mark as read
Send email with review:
create_draft to compose the email
get_draft to review content
send_draft to send, or delete_draft to discard
Reply to a conversation:
list_messages with a search query to find the thread
get_message to read the message you want to reply to
reply_message with the message_id and your response
Organize inbox:
list_messages to find messages
list_labels to see available labels
modify_labels to apply labels, archive, or star messages
Important Notes
- Attachments: Provide public URLs for file attachments. The files are fetched and attached automatically. Content type is auto-detected if not specified.
- HTML emails: You can send both
body_text and body_html together. Recipients who support HTML will see the rich version; others see plain text.
- Search syntax: The
q parameter uses standard Gmail search operators. Combine multiple operators for precise filtering (e.g., from:alice@example.com newer_than:7d has:attachment).
- Pagination: When
list_messages returns a next_page_token, pass it as page_token in the next request to get more results.
- From address: The
from_email field only works if you have configured a send-as alias in Gmail settings.
- Thread management: Use
thread_id with send_message or create_draft to add a message to an existing conversation thread.