Skip to main content
These workflows show how to chain AgentPost MCP tools together to accomplish end-to-end tasks. Each workflow maps directly to a set of sequential tool calls your agent makes.
Use this workflow to create a temporary inbox, wait for a message to arrive, and clean up afterward. This is the most common AgentPost pattern — for example, automating sign-up verification flows.
1

Create a mailbox

Call CreateMailbox with no arguments to get a new address on the default AgentPost domain.
// Tool: CreateMailbox
// Input: {}
// Output:
{
  "id": "mbx_01abc",
  "email_address": "calm.brook-42@agent.agentpost.email",
  "domain": "agent.agentpost.email",
  "can_send": false,
  "created_at": "2026-03-31T10:00:00Z"
}
The email_address field is the address your agent hands off to whatever external system needs to send you an email.
2

Use the address externally

Submit the email address to the service you’re automating — a sign-up form, a password reset flow, a notification trigger, etc. The mailbox starts accepting mail immediately after creation.
3

Wait for the email to arrive

Call WaitForEmail with the address. The tool streams a notifications/progress event every 2 seconds so your agent knows it’s still running, then returns the full message when it arrives.
// Tool: WaitForEmail
// Input:
{
  "email_address": "calm.brook-42@agent.agentpost.email",
  "timeout": 60,
  "format": "html2text"
}
// Output (on success):
{
  "status": "received",
  "id": "msg_01xyz",
  "subject": "Verify your email address",
  "from": "noreply@example.com",
  "text_content": "Click here to verify: https://example.com/verify?token=abc123",
  "thread_id": "thr_01def",
  "has_attachments": false
}
WaitForEmail only detects emails that arrive after the tool is called. Always call CreateMailbox before submitting the address externally, and call WaitForEmail before you expect the message to arrive.
If the timeout expires before a message arrives, the response returns "status": "timeout". Your agent can call WaitForEmail again to extend the wait, or fall back to ListMailboxEmails to check for messages that arrived during the gap.
4

Or: list and read emails manually

Instead of WaitForEmail, your agent can poll by calling ListMailboxEmails to see all messages in the inbox, then ReadEmail to fetch the full content of a specific one.
// Tool: ListMailboxEmails
// Input:
{ "email_address": "calm.brook-42@agent.agentpost.email" }

// Tool: ReadEmail
// Input:
{ "message_id": "msg_01xyz", "format": "html2text" }
Use include_body: true on ListMailboxEmails if you want previews without an extra ReadEmail round trip.
5

Clean up

Delete the email or the entire mailbox when your workflow is done.
// Tool: DeleteEmail
// Input:
{ "message_id": "msg_01xyz" }

// Or remove everything at once:
// Tool: DeleteMailbox
// Input:
{ "email_address": "calm.brook-42@agent.agentpost.email" }
Both operations are irreversible. DeleteMailbox cascades to all messages in the inbox.