Overview
Enable your agents to manage emails, contacts, and drafts through Gmail. Send emails, search messages, manage contacts, create drafts, and streamline your email communications with AI-powered automation.Prerequisites
Before using the Gmail integration, ensure you have:- A CrewAI AMP account with an active subscription
- A Gmail account with appropriate permissions
- Connected your Gmail account through the Integrations page
Setting Up Gmail Integration
1. Connect Your Gmail Account
- Navigate to CrewAI AMP Integrations
- Find Gmail in the Authentication Integrations section
- Click Connect and complete the OAuth flow
- Grant the necessary permissions for email and contact management
- Copy your Enterprise Token from Integration Settings
2. Install Required Package
Available Actions
gmail/fetch_emails
gmail/fetch_emails
Description: Retrieve a list of messages.Parameters:
userId(string, required): The user’s email address or ‘me’ for the authenticated user. (default: “me”)q(string, optional): Search query to filter messages (e.g., ‘from:someone@example.com is:unread’).maxResults(integer, optional): Maximum number of messages to return (1-500). (default: 100)pageToken(string, optional): Page token to retrieve a specific page of results.labelIds(array, optional): Only return messages with labels that match all of the specified label IDs.includeSpamTrash(boolean, optional): Include messages from SPAM and TRASH in the results. (default: false)
gmail/send_email
gmail/send_email
Description: Send an email.Parameters:
to(string, required): Recipient email address.subject(string, required): Email subject line.body(string, required): Email message content.userId(string, optional): The user’s email address or ‘me’ for the authenticated user. (default: “me”)cc(string, optional): CC email addresses (comma-separated).bcc(string, optional): BCC email addresses (comma-separated).from(string, optional): Sender email address (if different from authenticated user).replyTo(string, optional): Reply-to email address.threadId(string, optional): Thread ID if replying to an existing conversation.
gmail/delete_email
gmail/delete_email
Description: Delete an email by ID.Parameters:
userId(string, required): The user’s email address or ‘me’ for the authenticated user.id(string, required): The ID of the message to delete.
gmail/create_draft
gmail/create_draft
Description: Create a new draft email.Parameters:
userId(string, required): The user’s email address or ‘me’ for the authenticated user.message(object, required): Message object containing the draft content.raw(string, required): Base64url encoded email message.
gmail/get_message
gmail/get_message
Description: Retrieve a specific message by ID.Parameters:
userId(string, required): The user’s email address or ‘me’ for the authenticated user. (default: “me”)id(string, required): The ID of the message to retrieve.format(string, optional): The format to return the message in. Options: “full”, “metadata”, “minimal”, “raw”. (default: “full”)metadataHeaders(array, optional): When given and format is METADATA, only include headers specified.
gmail/get_attachment
gmail/get_attachment
Description: Retrieve a message attachment.Parameters:
userId(string, required): The user’s email address or ‘me’ for the authenticated user. (default: “me”)messageId(string, required): The ID of the message containing the attachment.id(string, required): The ID of the attachment to retrieve.
gmail/fetch_thread
gmail/fetch_thread
Description: Retrieve a specific email thread by ID.Parameters:
userId(string, required): The user’s email address or ‘me’ for the authenticated user. (default: “me”)id(string, required): The ID of the thread to retrieve.format(string, optional): The format to return the messages in. Options: “full”, “metadata”, “minimal”. (default: “full”)metadataHeaders(array, optional): When given and format is METADATA, only include headers specified.
gmail/modify_thread
gmail/modify_thread
Description: Modify the labels applied to a thread.Parameters:
userId(string, required): The user’s email address or ‘me’ for the authenticated user. (default: “me”)id(string, required): The ID of the thread to modify.addLabelIds(array, optional): A list of IDs of labels to add to this thread.removeLabelIds(array, optional): A list of IDs of labels to remove from this thread.
gmail/trash_thread
gmail/trash_thread
Description: Move a thread to the trash.Parameters:
userId(string, required): The user’s email address or ‘me’ for the authenticated user. (default: “me”)id(string, required): The ID of the thread to trash.
gmail/untrash_thread
gmail/untrash_thread
Description: Remove a thread from the trash.Parameters:
userId(string, required): The user’s email address or ‘me’ for the authenticated user. (default: “me”)id(string, required): The ID of the thread to untrash.
Usage Examples
Basic Gmail Agent Setup
Filtering Specific Gmail Tools
Email Search and Analysis
Thread Management
Getting Help
Need Help?
Contact our support team for assistance with Gmail integration setup or troubleshooting.
