Gmail integration: operations for AI agents
Gmail connects to Type.com as an integration. This page lists the 14 operations documented for Claude and Codex in Type.com: 7 read, 5 write, 2 destructive.
About Gmail
Search, read, draft, send and organize email in your Gmail mailbox, including bulk labeling, sender audits and one-click unsubscribe.
Categories: Email
How to connect Gmail to Type.com
- Connect
- Sign in with Google (OAuth)
- Access
- Personal connection: each person connects their own account.
To add the connection, follow the steps in Space connections.
Documented operations
14 operations. Your connection's permissions determine which operations are available.
- Read
Gmail get attachment
Download a Gmail message attachment into Type file delivery. Use gmail_get_email or gmail_get_thread first to discover attachment IDs, filenames, MIME types, and sizes. Returns a Type file ID instead of inlining attachment bytes.
- Read
Gmail get email
Get the full content of a specific email by its message ID. Returns headers, labels, and the message body text. Use gmail_search_emails first to find message IDs.
- Read
Gmail get thread
Get an entire email conversation (thread) with all messages. Returns all messages in the thread with their full content. Use the threadId from gmail_search_emails or gmail_get_email results.
- Read
Gmail list labels
List all Gmail labels (folders) available in the user's account. Returns both system labels (INBOX, SENT, etc.) and user-created labels. Set includeCounts to get exact message and thread totals per label, e.g. to count the inbox or confirm inbox zero. Use label IDs with gmail_modify_labels or gmail_batch_modify_labels to organize emails.
- Read
Gmail list message ids
List up to 500 message IDs per page for a Gmail search query, without fetching message content. Returns Gmail's resultSizeEstimate and a nextPageToken. Use this to collect IDs for gmail_batch_modify_labels; use gmail_search_emails or gmail_summarize_by_from to review what the messages are first.
- Read
Gmail search emails
Search emails using Gmail query syntax. Supports operators like from:, to:, subject:, is:unread, has:attachment, after:, before:, label:. Returns message metadata (id, subject, from, date, snippet) — use gmail_get_email for full content. Supports pagination via pageToken. Large results may be truncated.
- Read
Gmail summarize by from
Group messages matching a Gmail search query by sender address. Scans up to 1000 messages per call and returns, per sender: message and unread counts, newest and oldest dates, sample subjects, whether it advertises List-Unsubscribe, and a sample message ID. Use this to audit a large inbox by sender before bulk archiving; continue with nextPageToken to scan further. A call may scan fewer than maxMessages to keep the response complete; nextPageToken always resumes at the first message not yet summarized. compacted: true means sample subjects were omitted to fit every sender.
- Write
Gmail create draft
Create an email draft without sending it, with optional Type file attachments via attachmentFileIds. The draft will appear in the user's Gmail Drafts folder for review and manual sending. To draft a reply or follow-up in an existing conversation, first use gmail_get_email or gmail_get_thread, pass the latest thread message's messageId as threadAnchorMessageId, and reuse its subject (optionally prefixed with 'Re: '). Without threadAnchorMessageId, Gmail starts a new conversation.
- Write
Gmail modify labels
Add or remove labels from an email message. Use this to archive (remove INBOX), star (add STARRED), mark as read (remove UNREAD), mark as important (add IMPORTANT), or apply custom labels. Common labels: INBOX, STARRED, IMPORTANT, UNREAD, SPAM, TRASH, CATEGORY_PERSONAL, CATEGORY_SOCIAL, CATEGORY_PROMOTIONS.
- Write
Gmail reply to email
Reply to the sender of an inbound email that is not labeled SENT, with optional CC and BCC recipients. Do not use this tool for a follow-up to a message labeled SENT; use gmail_send_email with threadAnchorMessageId instead. Supports Type file attachments via attachmentFileIds. Automatically sets In-Reply-To and References headers to maintain threading. Use gmail_get_email first, then pass the exact replyTo value when present or from value otherwise as to. Messages labeled SENT are rejected even when they are also labeled INBOX. Messages labeled DRAFT are also rejected.
- Write
Gmail send email
Send a new email or an outbound follow-up to someone who has not replied. Use this tool, not gmail_reply_to_email, when continuing from a message labeled SENT in the connected mailbox. For that follow-up, first use gmail_get_email, pass its messageId as threadAnchorMessageId, and copy its subject exactly. Use gmail_reply_to_email only for an inbound message from another sender. Supports plain text or HTML body, CC, BCC, and Type file attachments via attachmentFileIds. Pass a json-render spec in visualization to automatically include the report as email HTML with embedded images; do not export or convert it first. Only send reports when the user requested email delivery. The explicit to, cc, and bcc fields remain the recipients of the new message.
- Write
Gmail unsubscribe
Unsubscribe from the mailing list that sent a message, using the sender's RFC 8058 one-click List-Unsubscribe endpoint. This sends a request to the sender, so confirm with the user first. When the sender does not support one-click unsubscribe, nothing is sent and the response returns the unsubscribe link or mailto address for the user. Does not archive existing mail.
- Destructive
Gmail batch modify labels
Add or remove the same labels on up to 1000 messages in one call, selected by messageIds or by a Gmail search query. Use this to bulk archive (remove INBOX), mark read (remove UNREAD), or file messages under a user label. With query, review what matches first (gmail_summarize_by_from or gmail_search_emails), then repeat while hasMore is true: pass nextPageToken when the change leaves messages matching the query, or omit it when the change removes them (e.g. archiving an in:inbox query). TRASH and SPAM cannot be changed in bulk. The response lists the affected messageIds. Swapping addLabels and removeLabels restores them only if they all had the same prior state for those labels, e.g. archiving messages selected with in:inbox; it cannot restore mixed states such as a batch where some messages were already read.
- Destructive
Gmail trash message
Move an email message to the trash. The message can be recovered from trash within 30 days. Use gmail_search_emails with 'in:trash' to find trashed messages.
No operations match.
Not supported
- Permanently deleting email (messages can only be moved to trash)
- Creating, renaming or deleting labels
- Changing Gmail settings, filters or forwarding
Example prompts
- Summarize the unread emails I got today and draft replies to anything urgent.
- Who sends me the most newsletters? Unsubscribe me from the ones I never open.
- Archive every promotional email older than 30 days.
Get started
- Open Space settings → Connections and search for Gmail.
- Connect your account and add the connection to the Space.
- Ask for what you need in any thread in that Space.
See How connections work for access and permissions, or browse all integrations.