Agent Mail connects to a Nagent workspace with an API key. Once it is connected, agents can call 5 Agent Mail actions, such as "Create Inbox", "Get Message" and "List Inboxes". It also has 1 trigger, "New Email Received", which can start agent work when that Agent Mail event happens. Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Each Agent Mailtrigger shows its configuration parameters and the payload your agent receives. A trigger fire is checked against the agent's level and logged, the same as work a person asked for.
AGENT_MAIL_NEW_EMAIL_TRIGGERTrigger for new emails in an AgentMail inbox
Configuration
The inbox ID or email address to monitor for new emails
Periodic Interval to Check for Updates & Send a Trigger in Minutes
Filter messages by specific labels (e.g., 'unread', 'inbox')
Payload
Message attachments
BCC email addresses
CC email addresses
When the message was created
Sender's email address
HTML content
ID of message being replied to
ID of the inbox
Labels applied to the message
ID of the message
Text preview of the message
IDs of previous messages in thread
Reply-to email addresses
Email subject
Plain text content
ID of the thread
When the message was received
Recipient email addresses
When the message was last updated
Every operation an agent can call against Agent Mail, with input parameters and output schema.
AGENT_MAIL_CREATE_INBOXCreate a new AgentMail inbox via API. Returns the inbox_id and email address for sending/receiving messages. Use when provisioning new inboxes for agents or workflows.
Input parameters
Domain for the inbox email address. Must be a verified domain in your AgentMail account. Defaults to 'agentmail.to' if not provided.
Username for the inbox. Used to create the email address (username@domain). If not provided, a random username will be generated.
Client-side identifier for idempotency or correlation. Can be used to prevent duplicate inbox creation or to associate the inbox with your internal systems.
Display name for the inbox (shown as the sender name in emails)
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
AGENT_MAIL_GET_MESSAGERetrieve the complete details of a specific email message from an AgentMail inbox. This action returns the full message content including sender, recipients, subject, body (both text and HTML), attachments, labels, and metadata. Use this to read individual messages after discovering them via LIST_MESSAGES or webhooks.
Input parameters
MUST be a valid email address (e.g., agent@agentmail.to). This is NOT an ID or identifier - it must be a full email address of the inbox.
The unique message identifier (NOT an email address). Get this from the 'message_id' field returned by LIST_MESSAGES.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
AGENT_MAIL_LIST_INBOXESList all inboxes available to the authenticated AgentMail account. Use this to discover valid inbox_id values for message operations.
Input parameters
Maximum number of inboxes to return per page
Sort inboxes in ascending order by created_at timestamp (oldest first). Default is descending (newest first)
Token for pagination to get the next set of results
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
AGENT_MAIL_LIST_MESSAGESList messages from an AgentMail inbox. Returns a `messages` array; each message uses `message_id` and `timestamp` fields (not `id`, `date`, or `items`).
Input parameters
Return messages sent after this timestamp (ISO 8601 format)
Maximum number of messages to return (1-100)
Return messages sent before this timestamp (ISO 8601 format)
Filter messages by labels (e.g., 'sent', 'unread', 'important')
MUST be a valid email address (e.g., agent@agentmail.to). This is NOT an ID or identifier - it must be a full email address of the inbox.
Sort messages in ascending order by timestamp (oldest first). Default is descending (newest first)
Token for pagination to get the next set of results
Include messages marked as spam in the results
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
AGENT_MAIL_SEND_EMAILSend an email using AgentMail API
Input parameters
List of CC recipient email addresses
List of recipient email addresses
List of BCC recipient email addresses
HTML content of the email. Either text or html (or both) must be provided. If both are provided, email clients will typically prefer HTML with text as fallback.
Plain text content of the email. Either text or html (or both) must be provided.
Labels to apply to the sent message
Email subject line
The inbox identifier (typically the full email address, e.g., 'your-inbox@agentmail.to'). Use AGENT_MAIL_LIST_INBOXES to discover available inbox IDs, or AGENT_MAIL_CREATE_INBOX to create a new inbox.
Reply-to email addresses
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 5 Agent Mail actions on Nagent, including "Create Inbox", "Get Message" and "List Inboxes". Create Inbox: Create a new AgentMail inbox via API. Each action is listed on this page with its input parameters and its output.
Agent Mail connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
Yes. Agent Mail has 1 trigger on Nagent, "New Email Received", a poll trigger. It needs inbox_id, and takes an optional interval and labels. A trigger fire is checked against the agent's level and logged, the same as work a person asked for.
It also takes 4 optional inputs: domain, username, client_id and display_name. It returns data, error and successful.