Gmail MCP Server for Cloudflare Workers
Test Gmail tools directly in your browser. Select a tool and provide inputs to see the results.
Create a free account to test Gmail tools interactively. No credit card required.
gmail_trash_messageMove a message to the trash. Args: - messageId: The ID of the message to trash Returns: The trashed message.
gmail_untrash_messageRestore a message from the trash. Args: - messageId: The ID of the message to restore Returns: The restored message.
gmail_delete_messagePermanently delete a message. This action cannot be undone. Args: - messageId: The ID of the message to delete Returns: Confirmation of deletion.
gmail_batch_delete_messagesPermanently delete multiple messages at once. This action cannot be undone. Args: - ids: List of message IDs to delete Returns: Confirmation of batch deletion.
gmail_create_forwarding_addressAdd a new forwarding address. Requires verification. Args: - email: The email address to add Returns: The created forwarding address (pending verification).
gmail_delete_forwarding_addressDelete a forwarding address. Args: - email: The forwarding email address to delete Returns: Confirmation of deletion.
gmail_get_profileGet the current user's Gmail profile. Returns: Profile information including email address, total messages, total threads, and the current history ID (useful for tracking changes).
gmail_get_auto_forwardingGet auto-forwarding settings. Returns: Current auto-forwarding settings.
gmail_update_language_settingsUpdate Gmail display language. Args: - displayLanguage: BCP 47 language tag (e.g., 'en', 'es', 'fr', 'de') Returns: Updated language settings.
gmail_list_send_asList all send-as aliases. Returns: List of send-as aliases with their settings.
gmail_get_attachmentGet an attachment from a message. The attachment data is returned as base64url encoded. You can find the attachmentId in the message payload when getting a message with format 'full'. Args: - messageId: The ID of the message containing the attachment - attachmentId: The ID of the attachment to retrieve - format: Response format ('json' or 'markdown') Returns: The attachment data (base64url encoded) and size.
gmail_list_draftsList drafts in the user's mailbox. Args: - query: Search query (Gmail search syntax) - maxResults: Maximum number of drafts to return (1-500, default: 20) - pageToken: Token for pagination from previous response - includeSpamTrash: Include drafts from SPAM and TRASH - format: Response format ('json' or 'markdown') Returns: Paginated list of drafts with IDs and associated message info.
gmail_get_draftGet a specific draft by ID. Args: - draftId: The ID of the draft to retrieve - format: Message format ('minimal', 'full', 'raw', 'metadata') - responseFormat: Response format ('json' or 'markdown') Returns: The draft with its message content.
gmail_create_draftCreate a new draft email. Args: - to: Recipient email address(es) - subject: Email subject - body: Email body (HTML supported) - cc: CC recipients (optional) - bcc: BCC recipients (optional) - threadId: Thread ID for reply drafts (optional) Returns: The created draft.
gmail_update_draftUpdate an existing draft (replaces the content). Args: - draftId: The ID of the draft to update - to: Recipient email address(es) - subject: Email subject - body: Email body (HTML supported) - cc: CC recipients (optional) - bcc: BCC recipients (optional) Returns: The updated draft.
gmail_send_draftSend an existing draft. Args: - draftId: The ID of the draft to send Returns: The sent message.
gmail_delete_draftDelete a draft. This action cannot be undone. Args: - draftId: The ID of the draft to delete Returns: Confirmation of deletion.
gmail_list_historyList the history of changes to the mailbox. Use this to track changes since a known point in time. Get the startHistoryId from a previous message, thread, or profile response. Args: - startHistoryId: Required. Returns history records after this ID - maxResults: Maximum number of history records to return (1-500) - pageToken: Token for pagination from previous response - labelId: Only return messages with this label - historyTypes: Types of history to return (messageAdded, messageDeleted, labelAdded, labelRemoved) - format: Response format ('json' or 'markdown') Returns: List of history records showing changes since the start history ID.
gmail_list_labelsList all labels in the user's mailbox. Args: - format: Response format ('json' or 'markdown') Returns: List of all labels with their IDs, names, types, and message counts.
gmail_get_labelGet a specific label by ID. Args: - labelId: The ID of the label (e.g., "INBOX", "STARRED", or custom label ID) - format: Response format ('json' or 'markdown') Returns: The label with all details including message and thread counts.
gmail_create_labelCreate a new label. Args: - name: The display name of the label - labelListVisibility: Visibility in label list ('labelShow', 'labelShowIfUnread', 'labelHide') - messageListVisibility: Visibility in message list ('show', 'hide') - backgroundColor: Background color in hex (e.g., "#16a765") - textColor: Text color in hex (e.g., "#ffffff") Returns: The created label.
gmail_update_labelUpdate a label (full replacement). Args: - labelId: The ID of the label to update - name: New display name - labelListVisibility: Visibility in label list - messageListVisibility: Visibility in message list - backgroundColor: Background color in hex - textColor: Text color in hex Returns: The updated label.
gmail_patch_labelPartially update a label (only specified fields). Args: - labelId: The ID of the label to patch - name: New display name (optional) - labelListVisibility: Visibility in label list (optional) - messageListVisibility: Visibility in message list (optional) - backgroundColor: Background color in hex (optional) - textColor: Text color in hex (optional) Returns: The patched label.
gmail_delete_labelDelete a label. System labels cannot be deleted. Args: - labelId: The ID of the label to delete Returns: Confirmation of deletion.
gmail_list_messagesList messages in the user's mailbox with optional filtering. Args: - query: Search query (Gmail search syntax, e.g., "from:sender@example.com", "is:unread", "subject:hello") - maxResults: Maximum number of messages to return (1-500, default: 20) - pageToken: Token for pagination from previous response - labelIds: Only return messages with these label IDs (e.g., ["INBOX", "UNREAD"]) - includeSpamTrash: Include messages from SPAM and TRASH (default: false) - format: Response format ('json' or 'markdown') Returns: Paginated list of messages with IDs and thread IDs.
gmail_get_messageGet a specific message by ID. Args: - messageId: The ID of the message to retrieve - format: Message format ('minimal', 'full', 'raw', 'metadata') - minimal: Only id and labels - full: Full message with parsed payload (default) - raw: Full message in base64url encoded raw format - metadata: Only metadata headers - responseFormat: Response format ('json' or 'markdown') Returns: The message with requested format and details.
gmail_send_messageSend an email message. Args: - to: Recipient email address(es), comma-separated for multiple - subject: Email subject - body: Email body (HTML supported) - cc: CC recipients, comma-separated (optional) - bcc: BCC recipients, comma-separated (optional) - threadId: Thread ID to reply to (optional, for threading) - inReplyTo: Message-ID header of the message being replied to (optional) - references: References header for threading (optional) Returns: The sent message with ID and thread ID.
gmail_modify_messageModify the labels on a message. Args: - messageId: The ID of the message to modify - addLabelIds: List of label IDs to add (e.g., ["STARRED", "IMPORTANT"]) - removeLabelIds: List of label IDs to remove (e.g., ["UNREAD"]) Returns: The modified message.
gmail_batch_modify_messagesModify labels on multiple messages at once. Args: - ids: List of message IDs to modify - addLabelIds: List of label IDs to add to all messages - removeLabelIds: List of label IDs to remove from all messages Returns: Confirmation of batch modification.
gmail_watchSet up push notifications for mailbox changes. This sets up a watch on the user's mailbox. When changes occur, notifications are sent to the specified Cloud Pub/Sub topic. Args: - topicName: Cloud Pub/Sub topic name (e.g., "projects/myproject/topics/mytopic") - labelIds: Only notify about messages with these labels (optional) - labelFilterAction: How to use labelIds - 'include' or 'exclude' (default: include) Returns: Watch response with historyId and expiration time.
gmail_stopStop receiving push notifications for mailbox changes. This stops any existing watch on the user's mailbox. Returns: Confirmation that notifications have been stopped.
gmail_get_vacation_settingsGet vacation auto-reply settings. Returns: Current vacation settings including enabled status, response text, and date range.
gmail_update_vacation_settingsUpdate vacation auto-reply settings. Args: - enableAutoReply: Whether to enable auto-reply - responseSubject: Subject line for auto-reply - responseBodyPlainText: Plain text body for auto-reply - responseBodyHtml: HTML body for auto-reply - restrictToContacts: Only reply to contacts - restrictToDomain: Only reply to same domain - startTime: Start time (epoch milliseconds) - endTime: End time (epoch milliseconds) Returns: Updated vacation settings.
gmail_list_filtersList all message filters. Returns: List of all filters with their criteria and actions.
gmail_get_filterGet a specific filter by ID. Args: - filterId: The ID of the filter Returns: The filter with criteria and action details.
gmail_create_filterCreate a new message filter. Args: Criteria (at least one required): - from: Sender address to match - to: Recipient address to match - subject: Subject to match - query: General search query - negatedQuery: Query for messages NOT to match - hasAttachment: Whether message has attachments - excludeChats: Exclude chat messages - size: Size in bytes - sizeComparison: 'larger' or 'smaller' Actions (at least one required): - addLabelIds: Labels to add - removeLabelIds: Labels to remove - forward: Email to forward to Returns: The created filter.
gmail_delete_filterDelete a message filter. Args: - filterId: The ID of the filter to delete Returns: Confirmation of deletion.
gmail_list_forwarding_addressesList all forwarding addresses. Returns: List of forwarding addresses with verification status.
gmail_get_forwarding_addressGet a specific forwarding address. Args: - email: The forwarding email address Returns: The forwarding address with verification status.
gmail_update_auto_forwardingUpdate auto-forwarding settings. Args: - enabled: Enable/disable auto-forwarding - emailAddress: Address to forward to (must be verified) - disposition: What to do with forwarded messages ('leaveInInbox', 'archive', 'trash', 'markRead') Returns: Updated auto-forwarding settings.
gmail_get_send_asGet a specific send-as alias. Args: - email: The send-as email address Returns: The send-as alias settings.
gmail_create_send_asCreate a new send-as alias. Requires verification. Args: - sendAsEmail: The email address - displayName: Display name for the alias - replyToAddress: Reply-to address - signature: Email signature (HTML) - treatAsAlias: Whether to treat as alias Returns: The created send-as alias (may require verification).
gmail_update_send_asUpdate a send-as alias. Args: - email: The send-as email to update - displayName: New display name - replyToAddress: New reply-to address - signature: New signature (HTML) - treatAsAlias: Whether to treat as alias - isDefault: Make this the default send-as Returns: The updated send-as alias.
gmail_delete_send_asDelete a send-as alias. Args: - email: The send-as email to delete Returns: Confirmation of deletion.
gmail_verify_send_asSend a verification email for a send-as alias. Args: - email: The send-as email to verify Returns: Confirmation that verification email was sent.
gmail_list_delegatesList all delegates who have access to this account. Returns: List of delegates with their email and verification status.
gmail_get_delegateGet a specific delegate. Args: - email: The delegate email address Returns: The delegate with verification status.
gmail_create_delegateAdd a delegate to this account. Requires verification. Args: - email: The email of the person to add as delegate Returns: The created delegate (pending verification).
gmail_delete_delegateRemove a delegate from this account. Args: - email: The delegate email to remove Returns: Confirmation of removal.
gmail_get_imap_settingsGet IMAP access settings. Returns: Current IMAP settings.
gmail_update_imap_settingsUpdate IMAP access settings. Args: - enabled: Enable/disable IMAP - autoExpunge: Auto-expunge on delete - expungeBehavior: What to do on expunge ('archive', 'trash', 'deleteForever') - maxFolderSize: Maximum folder size Returns: Updated IMAP settings.
gmail_get_pop_settingsGet POP access settings. Returns: Current POP settings.
gmail_update_pop_settingsUpdate POP access settings. Args: - accessWindow: Message access window ('disabled', 'fromNowOn', 'allMail') - disposition: What to do after POP download ('leaveInInbox', 'archive', 'trash', 'markRead') Returns: Updated POP settings.
gmail_get_language_settingsGet Gmail display language settings. Returns: Current language settings.
gmail_list_threadsList email threads in the user's mailbox with optional filtering. Args: - query: Search query (Gmail search syntax) - maxResults: Maximum number of threads to return (1-500, default: 20) - pageToken: Token for pagination from previous response - labelIds: Only return threads with these label IDs - includeSpamTrash: Include threads from SPAM and TRASH (default: false) - format: Response format ('json' or 'markdown') Returns: Paginated list of threads with IDs and snippets.
gmail_get_threadGet a specific thread with all its messages. Args: - threadId: The ID of the thread to retrieve - format: Message format ('minimal', 'full', 'raw', 'metadata') - responseFormat: Response format ('json' or 'markdown') Returns: The thread with all messages.
gmail_modify_threadModify the labels on all messages in a thread. Args: - threadId: The ID of the thread to modify - addLabelIds: List of label IDs to add - removeLabelIds: List of label IDs to remove Returns: The modified thread.
gmail_trash_threadMove a thread and all its messages to the trash. Args: - threadId: The ID of the thread to trash Returns: The trashed thread.
gmail_untrash_threadRestore a thread and all its messages from the trash. Args: - threadId: The ID of the thread to restore Returns: The restored thread.
gmail_delete_threadPermanently delete a thread and all its messages. This action cannot be undone. Args: - threadId: The ID of the thread to delete Returns: Confirmation of deletion.
gmail_trash_message{
"messageId": "example_messageId"
}gmail_untrash_message{
"messageId": "example_messageId"
}gmail_delete_message{
"messageId": "example_messageId"
}