// connections

AgentMail

Give agents their own AgentMail inboxes to send, receive, reply to and forward email, with threads, drafts, labels and event webhooks. Connect with an AgentMail API key.

17 mcp tools36 operations
rest
https://api.superagnt.com/v1/connections/agentmail plus the vendor's own path, with your superagnt_ API key as Authorization: Bearer.
mcp
Tools named connection_agentmail_* on https://mcp.superagnt.com/mcp, served once the account is connected.
billing
AgentMail bills your own account. Calls cost no superagnt_ data credits.
rate limit
10 requests a second, 600 a minute: the vendor's ceiling as the registry records it, for sizing bursts. Your plan's own limit is on Connections.

The AgentMail connection gives an agent email inboxes of its own. It creates inboxes, sends new messages, replies and forwards, reads threads and messages with their attachments, saves drafts to send now or at a set time, labels threads and messages, counts message events, and registers webhooks that push new mail and delivery events to a URL.

01

Setup

  1. Create an API key. In your AgentMail dashboard, create an API key. AgentMail bills usage to that account directly.
  2. Connect AgentMail. In the superagnt app open Integrations, pick AgentMail, paste the key and press Connect.

02

Things to know

  • Create an inbox with connection_agentmail_inboxes_write action create. Leave out username and AgentMail picks a random one. domain defaults to agentmail.to, and any other domain must be verified in AgentMail first. The message, thread and draft tools take the inbox_id the call returns.
  • get_organization shows the organization's inbox and domain limits and how many of each are in use.
  • Lists page with limit and page_token. Message, thread and draft lists also filter by labels and before or after timestamps. To see spam, blocked, unauthenticated or trashed messages, pass include_spam, include_blocked, include_unauthenticated or include_trash.
  • Attachments and a message's raw .eml source come back as expiring download URLs, not as file content.
  • batch_get_messages returns the metadata, without bodies, of up to 500 messages in one call.
  • System labels (sent, received, bounced and the like) cannot be added or removed, and update_thread rejects a thread with 100 or more messages.
  • delete_thread moves a thread to trash. A thread already in trash, or one deleted with permanent=true, is gone for good.
  • A draft saved with send_at is sent by AgentMail at that time, with no further call.
  • Sending a message, a reply, a reply-all, a forward or a draft, and every delete, always ask a person first by default. Everything else runs without asking, saving a draft with send_at included: see Permissions.
  • The connection does not cover AgentMail account administration: API keys, domains and pods stay managed in AgentMail.

Webhooks

  • connection_agentmail_webhooks_write action create posts the event_types you pick to your url: message.received (and its .spam, .blocked and .unauthenticated variants), message.sent, message.delivered, message.bounced, message.complained, message.rejected and domain.verified.
  • A webhook can be scoped to up to 10 inbox_ids and up to 10 pod_ids.
  • Point it at a superagnt_ inbound webhook endpoint to start an agent when mail arrives. AgentMail signs each delivery with the webhook's secret, which an inbound endpoint does not check, so leave the endpoint's signature verification off and keep its URL secret.
  • Without a webhook, poll list_messages with after set to the time of your last check.

03

Examples

Create an inbox

create an inboxbash
curl -X POST "https://api.superagnt.com/v1/connections/agentmail/v0/inboxes" \
  -H "Authorization: Bearer $AGNTDATA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "support-agent", "display_name": "Support Agent"}'

Send a message

send from an inboxbash
curl -X POST "https://api.superagnt.com/v1/connections/agentmail/v0/inboxes/<inbox_id>/messages/send" \
  -H "Authorization: Bearer $AGNTDATA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "jenny.rosen@example.com",
    "subject": "Your order has shipped",
    "text": "Hi Jenny, your order left our warehouse today."
  }'

Push new mail to an agent

webhook for received mailbash
curl -X POST "https://api.superagnt.com/v1/connections/agentmail/v0/webhooks" \
  -H "Authorization: Bearer $AGNTDATA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://api.superagnt.com/webhooks/ingest/<endpoint id>",
    "event_types": ["message.received"]
  }'
04// mcp tools

17 tools, one per resource and risk

MCP servers and agents on the grouped surface list AgentMail as these tools. Each takes an action, and the ones that work across record types an object. Every operation also keeps its own per-operation name, in the next table, which works on every server. How grouping works: Grouped tools.

ToolRiskActions
connection_agentmail_inboxes_read

Read AgentMail inboxes

List or get the organization's inboxes, or read an inbox's label-change events. Lists page with limit and page_token.

read
listgetlist_events
connection_agentmail_inboxes_write

Create and update AgentMail inboxes

Create an inbox or change its display name.

write
createupdate
connection_agentmail_inboxes_delete

Delete an AgentMail inbox

Delete an inbox for good. Cannot be undone.

destructive
delete
connection_agentmail_organization_read

Read AgentMail usage

Read the organization's limits and usage, or count message events (sent, delivered, bounced, delayed, rejected, complained, received) over a time range.

read
getquery_metrics
connection_agentmail_webhooks_read

Read AgentMail webhooks

List or get the organization's webhooks.

read
listget
connection_agentmail_webhooks_write

Create and update AgentMail webhooks

Create a webhook for message and domain events, or change the inboxes, pods and event types it covers.

write
createupdate
connection_agentmail_webhooks_delete

Delete an AgentMail webhook

Delete a webhook for good.

destructive
delete
connection_agentmail_threads_read

Read AgentMail threads

List an inbox's threads, get one with all its messages, or get a download link for an attachment in a thread. Lists filter by labels and before/after timestamps and page with limit and page_token.

read
listgetget_attachment
connection_agentmail_threads_write

Label AgentMail threads

Add or remove labels on a thread. System labels (sent, received, bounced and the like) cannot be changed, and threads with 100 or more messages are rejected.

write
update_labels
connection_agentmail_threads_delete

Delete an AgentMail thread

Move a thread to trash; a thread already in trash, or deleted with permanent: true, is deleted for good.

destructive
delete
connection_agentmail_messages_read

Read AgentMail messages

List and read an inbox's messages, fetch the metadata of up to 500 messages at once, or get a download link for a message's raw source or an attachment. Lists filter by labels and before/after timestamps and page with limit and page_token.

read
listgetbatch_getget_rawget_attachment
connection_agentmail_messages_send

Send AgentMail email

Send a new message from an inbox, reply or reply to all, forward a message, or send a saved draft. Each one delivers real email to its recipients and cannot be recalled.

write
sendreplyreply_allforwardsend_draft
connection_agentmail_messages_write

Label AgentMail messages

Add or remove labels on a message, such as read and unread.

write
update_labels
connection_agentmail_messages_delete

Delete an AgentMail message

Delete a message for good. Cannot be undone.

destructive
delete
connection_agentmail_drafts_read

Read AgentMail drafts

List or get an inbox's drafts, or get a download link for an attachment of a draft.

read
listgetget_attachment
connection_agentmail_drafts_write

Write AgentMail drafts

Save or edit a draft in an inbox. A draft with send_at is sent on its own at that time; connection_agentmail_messages_send sends one now.

write
createupdate
connection_agentmail_drafts_delete

Delete an AgentMail draft

Delete a draft for good.

destructive
delete
05// operations

All 36 operations

Each operation is a REST path under https://api.superagnt.com/v1/connections/agentmail and an MCP tool. The per-operation tool name is the one permissions, approvals and usage records use.

OperationMCP tool
GET/v0/inboxes

List Inboxes

connection_agentmail_list_inboxesgrouped: connection_agentmail_inboxes_read, action list
POST/v0/inboxes

Create Inbox

connection_agentmail_create_inboxgrouped: connection_agentmail_inboxes_write, action create
GET/v0/inboxes/{inbox_id}

Get Inbox

connection_agentmail_get_inboxgrouped: connection_agentmail_inboxes_read, action get
PATCH/v0/inboxes/{inbox_id}

Update Inbox

connection_agentmail_update_inboxgrouped: connection_agentmail_inboxes_write, action update
DELETE/v0/inboxes/{inbox_id}

Delete Inbox

connection_agentmail_delete_inboxgrouped: connection_agentmail_inboxes_delete, action delete
GET/v0/inboxes/{inbox_id}/drafts

List Drafts

connection_agentmail_list_draftsgrouped: connection_agentmail_drafts_read, action list
POST/v0/inboxes/{inbox_id}/drafts

Create Draft

connection_agentmail_create_draftgrouped: connection_agentmail_drafts_write, action create
GET/v0/inboxes/{inbox_id}/drafts/{draft_id}

Get Draft

connection_agentmail_get_draftgrouped: connection_agentmail_drafts_read, action get
PATCH/v0/inboxes/{inbox_id}/drafts/{draft_id}

Update Draft

connection_agentmail_update_draftgrouped: connection_agentmail_drafts_write, action update
DELETE/v0/inboxes/{inbox_id}/drafts/{draft_id}

Delete Draft

connection_agentmail_delete_draftgrouped: connection_agentmail_drafts_delete, action delete
GET/v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}

Get Attachment

connection_agentmail_get_draft_attachmentgrouped: connection_agentmail_drafts_read, action get_attachment
POST/v0/inboxes/{inbox_id}/drafts/{draft_id}/send

Send Draft

connection_agentmail_send_draftgrouped: connection_agentmail_messages_send, action send_draft
GET/v0/inboxes/{inbox_id}/events

List Inbox Events

connection_agentmail_list_inbox_eventsgrouped: connection_agentmail_inboxes_read, action list_events
GET/v0/inboxes/{inbox_id}/messages

List Messages

connection_agentmail_list_messagesgrouped: connection_agentmail_messages_read, action list
POST/v0/inboxes/{inbox_id}/messages/batch-get

Batch Get Messages

connection_agentmail_batch_get_messagesgrouped: connection_agentmail_messages_read, action batch_get
POST/v0/inboxes/{inbox_id}/messages/send

Send Message

connection_agentmail_send_messagegrouped: connection_agentmail_messages_send, action send
GET/v0/inboxes/{inbox_id}/messages/{message_id}

Get Message

connection_agentmail_get_messagegrouped: connection_agentmail_messages_read, action get
PATCH/v0/inboxes/{inbox_id}/messages/{message_id}

Update Message

connection_agentmail_update_messagegrouped: connection_agentmail_messages_write, action update_labels
DELETE/v0/inboxes/{inbox_id}/messages/{message_id}

Delete Message

connection_agentmail_delete_messagegrouped: connection_agentmail_messages_delete, action delete
GET/v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}

Get Attachment

connection_agentmail_get_message_attachmentgrouped: connection_agentmail_messages_read, action get_attachment
POST/v0/inboxes/{inbox_id}/messages/{message_id}/forward

Forward Message

connection_agentmail_forward_messagegrouped: connection_agentmail_messages_send, action forward
GET/v0/inboxes/{inbox_id}/messages/{message_id}/raw

Get Raw Message

connection_agentmail_get_raw_messagegrouped: connection_agentmail_messages_read, action get_raw
POST/v0/inboxes/{inbox_id}/messages/{message_id}/reply

Reply To Message

connection_agentmail_reply_to_messagegrouped: connection_agentmail_messages_send, action reply
POST/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all

Reply All Message

connection_agentmail_reply_all_messagegrouped: connection_agentmail_messages_send, action reply_all
GET/v0/inboxes/{inbox_id}/threads

List Threads

connection_agentmail_list_threadsgrouped: connection_agentmail_threads_read, action list
GET/v0/inboxes/{inbox_id}/threads/{thread_id}

Get Thread

connection_agentmail_get_threadgrouped: connection_agentmail_threads_read, action get
PATCH/v0/inboxes/{inbox_id}/threads/{thread_id}

Update Thread

connection_agentmail_update_threadgrouped: connection_agentmail_threads_write, action update_labels
DELETE/v0/inboxes/{inbox_id}/threads/{thread_id}

Delete Thread

connection_agentmail_delete_threadgrouped: connection_agentmail_threads_delete, action delete
GET/v0/inboxes/{inbox_id}/threads/{thread_id}/attachments/{attachment_id}

Get Attachment

connection_agentmail_get_thread_attachmentgrouped: connection_agentmail_threads_read, action get_attachment
GET/v0/metrics

Query Metrics

connection_agentmail_query_metricsgrouped: connection_agentmail_organization_read, action query_metrics
GET/v0/organizations

Get Organization

connection_agentmail_get_organizationgrouped: connection_agentmail_organization_read, action get
GET/v0/webhooks

List Webhooks

connection_agentmail_list_webhooksgrouped: connection_agentmail_webhooks_read, action list
POST/v0/webhooks

Create Webhook

connection_agentmail_create_webhookgrouped: connection_agentmail_webhooks_write, action create
GET/v0/webhooks/{webhook_id}

Get Webhook

connection_agentmail_get_webhookgrouped: connection_agentmail_webhooks_read, action get
PATCH/v0/webhooks/{webhook_id}

Update Webhook

connection_agentmail_update_webhookgrouped: connection_agentmail_webhooks_write, action update
DELETE/v0/webhooks/{webhook_id}

Delete Webhook

connection_agentmail_delete_webhookgrouped: connection_agentmail_webhooks_delete, action delete