Skip to content

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.

FieldWhat it does
Credential (required)The Google Gmail credential of the account the agent works with.
DescriptionDescriptive text for the toolkit. Default: Toolkit for gmail operations.

Advanced options

FieldWhat it does
From EmailThe sender shown on sent emails, in the format Name <email@domain.com>. Empty, the credential’s account is used.
CSS Style for PDF generationThe style (font, margins, colours) of the PDFs attached when sending an email.

Tools

ToolWhat it does
send_gmail_messageSends an email with recipients, subject, CC and BCC. It can attach texts, which are turned into PDF files.
create_email_draftCreates a draft without sending it.
reply_gmail_messageReplies to a specific email within its conversation.
search_emailSearches emails or conversations with Gmail search filters (sender, subject, dates, label…). Returns 10 results by default.
get_gmail_messageReads an email: sender, subject, body and, if asked, attachments.
get_gmail_threadReads a whole conversation.
mark_gmail_message_read_unreadMarks emails as read or unread.
update_gmail_labelChanges the labels of one or more emails. It removes the labels they had and applies the ones given.
get_gmail_labelLooks up a label or lists them all.
create_gmail_labelCreates a label.
delete_gmail_labelDeletes a label.
trash_or_untrash_gmail_threadMoves a conversation to the trash or restores it.
delete_gmail_messageDeletes an email permanently.
delete_gmail_threadDeletes 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.

  1. Add GmailToolkit with the Google Gmail credential of the firm’s mailbox.
  2. Connect BaseToolkit to the agent.
  3. 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.