Skip to main content

Gmail

Connects to the Gmail API for reading and sending email. An agent can list and search the inbox, read full message content, and send new emails.

Add to an agent node's tools array with _node_type: "tool-gmail". See Connector Reference — How connectors are used.

Authentication

FieldRequiredDescription
access_tokenYesOAuth2 access token for the Gmail API, sent as Authorization: Bearer <token>. Typically populated from a stored OAuth connection via oauth_connection_id.
{
"name": "gmail",
"_node_type": "tool-gmail",
"oauth_connection_id": "{{ connections.gmail }}"
}

Tools

gmail_list_emails

List emails from the Gmail inbox.

Parameters

ParameterTypeRequiredDescription
max_resultsnumberNoMax messages to list (default 10)
querystringNoGmail search query (e.g. is:unread, from:someone@example.com)

Returns: A newline-separated list of message summaries (From/To/Subject/Date/Snippet) for up to 5 messages, with a trailing "... and N more" line if there are additional matches, or "No messages found.".

gmail_get_email

Get the full content of a Gmail message.

Parameters

ParameterTypeRequiredDescription
message_idstringYesGmail message ID

Returns: A text block with the message ID, From/To/Subject/Date headers, and the message snippet.

gmail_send_email

Send an email via Gmail.

Parameters

ParameterTypeRequiredDescription
tostringYesRecipient email address
subjectstringYesEmail subject
bodystringYesEmail body (plain text)

Returns: A confirmation message including the recipient and the new message ID.

Search Gmail messages using Gmail query syntax.

Parameters

ParameterTypeRequiredDescription
querystringYesGmail search query (e.g. 'from:boss@company.com subject:report')
max_resultsnumberNoMax results (default 10)

Returns: A list of matching message summaries (From/To/Subject/Date/Snippet) for up to 5 results, separated by ---, or "No messages matching query.".

Next