SendGrid
Connects to the SendGrid API for sending transactional emails and managing marketing contacts. An agent can send plain/HTML emails, send dynamic template emails, and add or search contacts.
Add to an agent node's tools array with _node_type: "tool-sendgrid". See Connector Reference — How connectors are used.
Authentication
| Field | Required | Description |
|---|---|---|
api_key | Yes | SendGrid API key, sent as Authorization: Bearer <api_key>. Typically a stored secret. |
{
"name": "sendgrid",
"_node_type": "tool-sendgrid",
"api_key": "{{ secret.SENDGRID_API_KEY }}"
}
Tools
sendgrid_send_email
Send a transactional email via SendGrid.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient email address |
to_name | string | No | Recipient name |
from | string | Yes | Sender email address |
from_name | string | No | Sender name |
subject | string | Yes | Email subject |
html_content | string | No | HTML body |
text_content | string | No | Plain text body |
At least one of html_content or text_content is required.
Returns: A confirmation message with the recipient and HTTP status, e.g. "Email sent to <to> (status <code>)".
sendgrid_send_template
Send a dynamic template email via SendGrid.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient email |
from | string | Yes | Sender email |
template_id | string | Yes | Dynamic template ID |
data | object | No | Template dynamic data |
Returns: A confirmation message that the template email was sent to the recipient.
sendgrid_add_contact
Add or update a contact in SendGrid Marketing.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Contact email |
first_name | string | No | First name |
last_name | string | No | Last name |
list_id | string | No | Contact list ID to add to |
Returns: A confirmation message that the contact was added/updated.
sendgrid_list_contacts
Search contacts in SendGrid Marketing.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | No | Search query (e.g. email LIKE '%@example.com'); defaults to email != '' |
Returns: A count line followed by a newline-separated list of <first_name> <<email>> lines.