GmailToolkit
GmailToolkit gives an agent a set of tools to work with your Gmail account: send and reply to emails, create drafts, search and read messages, and organise the inbox with labels, read marks and the trash. The agent decides when to use each tool during the conversation.
When to use it
- An assistant that reads a customer’s emails and answers them.
- Sorting incoming emails with labels.
- Sending a report by email, with its content attached as a PDF.
- Finding a supplier’s old emails and summarising them.
Configuration
You need a Google Gmail credential, connected by signing in with your Google account. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Google Gmail credential of the account the agent works with. |
| Description | Descriptive text for the toolkit. Default: Toolkit for gmail operations. |
Advanced options
| Field | What it does |
|---|---|
| From Email | The sender shown on sent emails, in the format Name <email@domain.com>. Empty, the credential’s account is used. |
| CSS Style for PDF generation | The style (font, margins, colours) of the PDFs attached when sending an email. |
Tools
| Tool | What it does |
|---|---|
send_gmail_message | Sends an email with recipients, subject, CC and BCC. It can attach texts, which are turned into PDF files. |
create_email_draft | Creates a draft without sending it. |
reply_gmail_message | Replies to a specific email within its conversation. |
search_email | Searches emails or conversations with Gmail search filters (sender, subject, dates, label…). Returns 10 results by default. |
get_gmail_message | Reads an email: sender, subject, body and, if asked, attachments. |
get_gmail_thread | Reads a whole conversation. |
mark_gmail_message_read_unread | Marks emails as read or unread. |
update_gmail_label | Changes the labels of one or more emails. It removes the labels they had and applies the ones given. |
get_gmail_label | Looks up a label or lists them all. |
create_gmail_label | Creates a label. |
delete_gmail_label | Deletes a label. |
trash_or_untrash_gmail_thread | Moves a conversation to the trash or restores it. |
delete_gmail_message | Deletes an email permanently. |
delete_gmail_thread | Deletes a conversation permanently. |
Output
The BaseToolkit output is the set of tools. Connect it to an agent’s tools connector.
Example
A law firm wants an assistant that sorts customer emails.
- Add GmailToolkit with the Google Gmail credential of the firm’s mailbox.
- Connect BaseToolkit to the agent.
- In the agent’s instructions, ask it to find today’s unread emails, label customer emails “Customers” and mark them as read.
Best practices
- The tools that delete emails and conversations delete them permanently. If you don’t want the agent to delete anything, say so in its instructions or use a Gmail component with a single operation.
- Changing labels replaces the ones the email already had: ask the agent to include every label that must stay.
- Test the agent with a test account before connecting it to the real mailbox.
Related components
- Gmail Message: a single operation on emails.
- Tool Mode: how an agent uses tools.