emailinboxagentsautomation

Give your agents real email inboxes. Create inboxes programmatically, send, receive, reply, search, and manage threaded email conversations.

Installation

pnpm add agentmail-toolkit
# Add to your .env file
AGENTMAIL_API_KEY=your_api_key_here

Usage

import { generateText, isStepCount } from 'ai';
import { AgentMailToolkit } from 'agentmail-toolkit/ai-sdk';

const { text } = await generateText({
  model: 'anthropic/claude-sonnet-4-5',
  tools: new AgentMailToolkit().getTools(),
  stopWhen: isStepCount(5),
  prompt:
    'Create an inbox for yourself, then check it for new messages and reply to anything urgent.',
});

console.log(text);