Gmail Bubble
Gmail integration for email management
Quick Start
import { GmailBubble } from '@bubblelab/bubble-core';
import { CredentialType } from '@bubblelab/shared-schemas';
const result = await new GmailBubble({
operation: 'send_email',
credentials: {
[CredentialType.GMAIL_CRED]: process.env.GMAIL_CRED as string,
},
}).action();
Operation Details
send_email
- Input Schema
- Output Schema
operation'send_email' required- Send an email message
tostring[] required- List of recipient email addresses
ccstring[]- List of CC recipient email addresses
bccstring[]- List of BCC recipient email addresses
subjectstring required- Email subject line
body_textstring- Plain text email body
body_htmlstring- HTML email body
reply_tostring- Reply-to email address
thread_idstring- Thread ID to reply to (for threaded conversations)
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'send_email' required- Send an email message
successboolean required- Whether the email was sent successfully
message_idstring- Sent message ID
thread_idstring- Thread ID
errorstring required- Error message if operation failed
list_emails
- Input Schema
- Output Schema
operation'list_emails' required- List emails in the user mailbox
querystring- Gmail search query (e.g., "from:user@example.com is:unread")
label_idsstring[]- Filter by specific label IDs
include_spam_trashboolean- Include messages from SPAM and TRASH
max_resultsnumber- Maximum number of messages to return
page_tokenstring- Token for pagination to get next page
include_detailsboolean- Whether to fetch full message details including snippet, headers, and body
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'list_emails' required- List emails in the user mailbox
successboolean required- Whether the email list was retrieved successfully
messagesobject[]- List of email messages
next_page_tokenstring- Token for fetching next page
result_size_estimatenumber- Estimated total number of results
errorstring required- Error message if operation failed
get_email
- Input Schema
- Output Schema
operation'get_email' required- Get a specific email message
message_idstring required- Gmail message ID to retrieve
format'minimal' | 'full' | 'raw' | 'metadata'- Format to return the message in
metadata_headersstring[]- List of headers to include when format is metadata
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'get_email' required- Get a specific email message
successboolean required- Whether the email was retrieved successfully
messageobject- Email message details
errorstring required- Error message if operation failed
search_emails
- Input Schema
- Output Schema
operation'search_emails' required- Search emails with query
querystring required- Gmail search query string
max_resultsnumber- Maximum number of results to return
include_spam_trashboolean- Include messages from SPAM and TRASH
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'search_emails' required- Search emails with query
successboolean required- Whether the email search was completed successfully
messagesobject[]- List of matching email messages
result_size_estimatenumber- Estimated total number of results
errorstring required- Error message if operation failed
mark_as_read
- Input Schema
- Output Schema
operation'mark_as_read' required- Mark one or more messages as read
message_idsstring[] required- List of message IDs to mark as read
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'mark_as_read' required- Mark one or more messages as read
successboolean required- Whether the messages were marked as read successfully
modified_messagesstring[]- IDs of messages that were modified
errorstring required- Error message if operation failed
mark_as_unread
- Input Schema
- Output Schema
operation'mark_as_unread' required- Mark one or more messages as unread
message_idsstring[] required- List of message IDs to mark as unread
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'mark_as_unread' required- Mark one or more messages as unread
successboolean required- Whether the messages were marked as unread successfully
modified_messagesstring[]- IDs of messages that were modified
errorstring required- Error message if operation failed
create_draft
- Input Schema
- Output Schema
operation'create_draft' required- Create a draft email
tostring[] required- List of recipient email addresses
ccstring[]- List of CC recipient email addresses
bccstring[]- List of BCC recipient email addresses
subjectstring required- Email subject line
body_textstring- Plain text email body
body_htmlstring- HTML email body
reply_tostring- Reply-to email address
thread_idstring- Thread ID to reply to (for threaded conversations)
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'create_draft' required- Create a draft email
successboolean required- Whether the draft was created successfully
draftobject- Created draft
errorstring required- Error message if operation failed
send_draft
- Input Schema
- Output Schema
operation'send_draft' required- Send a draft email
draft_idstring required- Gmail draft ID to send
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'send_draft' required- Send a draft email
successboolean required- Whether the draft was sent successfully
message_idstring- Sent message ID
thread_idstring- Thread ID
errorstring required- Error message if operation failed
list_drafts
- Input Schema
- Output Schema
operation'list_drafts' required- List draft emails
querystring- Search query to filter drafts
max_resultsnumber- Maximum number of drafts to return
page_tokenstring- Token for pagination to get next page
include_spam_trashboolean- Include drafts from SPAM and TRASH
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'list_drafts' required- List draft emails
successboolean required- Whether the draft list was retrieved successfully
draftsobject[]- List of drafts
next_page_tokenstring- Token for fetching next page
result_size_estimatenumber- Estimated total number of results
errorstring required- Error message if operation failed
delete_email
- Input Schema
- Output Schema
operation'delete_email' required- Delete an email message permanently
message_idstring required- Gmail message ID to delete
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'delete_email' required- Delete an email message permanently
successboolean required- Whether the email was deleted successfully
deleted_message_idstring- ID of the deleted message
errorstring required- Error message if operation failed
trash_email
- Input Schema
- Output Schema
operation'trash_email' required- Move an email message to trash
message_idstring required- Gmail message ID to move to trash
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'trash_email' required- Move an email message to trash
successboolean required- Whether the email was moved to trash successfully
trashed_message_idstring- ID of the trashed message
errorstring required- Error message if operation failed
list_threads
- Input Schema
- Output Schema
operation'list_threads' required- List email threads
querystring- Gmail search query to filter threads
label_idsstring[]- Filter by specific label IDs
include_spam_trashboolean- Include threads from SPAM and TRASH
max_resultsnumber- Maximum number of threads to return
page_tokenstring- Token for pagination to get next page
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'list_threads' required- List email threads
successboolean required- Whether the thread list was retrieved successfully
threadsobject[]- List of email threads
next_page_tokenstring- Token for fetching next page
result_size_estimatenumber- Estimated total number of results
errorstring required- Error message if operation failed
list_labels
- Input Schema
- Output Schema
operation'list_labels' required- List all labels in mailbox
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'list_labels' required- List all labels in mailbox
successboolean required- Whether the label list was retrieved successfully
labelsobject[]- List of labels (both system and user labels)
errorstring required- Error message if operation failed
create_label
- Input Schema
- Output Schema
operation'create_label' required- Create a new custom label
namestring required- Label name (display name)
label_list_visibility'labelShow' | 'labelShowIfUnread' | 'labelHide'- Visibility in label list
message_list_visibility'show' | 'hide'- Visibility in message list
background_colorstring- Background color in hex format (e.g., #000000)
text_colorstring- Text color in hex format (e.g., #ffffff)
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'create_label' required- Create a new custom label
successboolean required- Whether the label was created successfully
labelobject- Created label details
errorstring required- Error message if operation failed
modify_message_labels
- Input Schema
- Output Schema
operation'modify_message_labels' required- Add or remove labels from a message
message_idstring required- Gmail message ID to modify
add_label_idsstring[]- List of label IDs to add (max 100)
remove_label_idsstring[]- List of label IDs to remove (max 100)
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'modify_message_labels' required- Add or remove labels from a message
successboolean required- Whether the labels were modified successfully
message_idstring- Modified message ID
label_idsstring[]- Current label IDs after modification
errorstring required- Error message if operation failed
modify_thread_labels
- Input Schema
- Output Schema
operation'modify_thread_labels' required- Add or remove labels from all messages in a thread
thread_idstring required- Gmail thread ID to modify
add_label_idsstring[]- List of label IDs to add to all messages in thread (max 100)
remove_label_idsstring[]- List of label IDs to remove from all messages in thread (max 100)
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'modify_thread_labels' required- Add or remove labels from all messages in a thread
successboolean required- Whether the thread labels were modified successfully
thread_idstring- Modified thread ID
errorstring required- Error message if operation failed