Gmail

The Gmail API is a RESTful API that can be used to access Gmail mailboxes and send mail. It lets you view and manage Gmail mailbox data like threads, messages, and labels.

Active

Capabilities (8)

List Email Messages

List email messages in the user's mailbox. Returns message IDs and thread IDs that can be used to fetch full message content with get_message. IMPORTANT: When a query is provided, use Gmail search operators, NOT natural language. Common queries: 'is:unread', 'in:inbox newer_than:1d', 'from:someone@email.com'. Without a query, returns the most recent messages. Gmail returns results newest-first by default.

list_messages(query?, max_results?) -> messages
Required scopes:
https://www.googleapis.com/auth/gmail.readonly

Get Email Thread

Get a complete email thread by ID.

get_thread(thread_id, format?) -> Thread
Required scopes:
https://www.googleapis.com/auth/gmail.readonly

Get Email Message

Get a specific email message by ID with full content.

get_message(message_id, format?) -> Message
Required scopes:
https://www.googleapis.com/auth/gmail.readonly

Modify Message Labels

Add or remove labels on a message.

modify_message(message_id, add_labels?, remove_labels?) -> Message
Required scopes:
https://www.googleapis.com/auth/gmail.modify

Send Email

Send an email from the authenticated user.

send_email(to, subject, body) -> Message
Required scopes:
https://www.googleapis.com/auth/gmail.send

Create Email Draft

Create a draft email.

create_draft(to, subject, body) -> Draft
Required scopes:
https://www.googleapis.com/auth/gmail.compose

List Labels

List all labels in the mailbox.

list_labels() -> labels
Required scopes:
https://www.googleapis.com/auth/gmail.readonly

Search Emails

Search for emails using Gmail search syntax. IMPORTANT: You must translate natural language requests into Gmail search operators. NEVER pass raw natural language as the query — Gmail does keyword matching, not semantic search. COMMON PATTERNS — translate user intent to these queries: • 'latest emails' / 'recent emails' → newer_than:1d (or newer_than:3d for more results) • 'unread emails' → is:unread • 'emails needing response' / 'emails requiring reply' → is:unread in:inbox newer_than:7d • 'emails from John' → from:john • 'emails about project X' → subject:project X • 'emails with attachments' → has:attachment • 'starred emails' → is:starred DATE OPERATORS: newer_than:1d (1 day), newer_than:7d (1 week), newer_than:1m (1 month), after:2025/01/01, before:2025/12/31. COMBINE operators: 'is:unread from:boss@company.com newer_than:3d' Gmail returns results newest-first by default.

search_emails(query, max_results?) -> messages
Required scopes:
https://www.googleapis.com/auth/gmail.readonly

Authentication

  • Oauth2_authorization_code (Primary)