Wraps Logo
Agent Quickstart

Send email from your agent

Wire Wraps into your agent's tool calls. The infrastructure lives in your AWS account; the agent just calls a typed function.

What you'll build

  • AWS SES deployed to your account (DKIM, SPF, DMARC included)
  • A typed send-email tool your agent framework can register as-is
  • Wraps docs in your AI editor's context via Context7 MCP

Time: ~5 minutes

Prerequisites

Before you begin, make sure you have:

  • Node.js 20 or later installed
  • An AWS account with valid credentials configured
  • An agent framework you already use (LangGraph, Vercel AI SDK, Mastra, or your own)

1
Deploy infrastructure

The CLI deploys SES, DKIM, bounce handling, and EventBridge event processing into your AWS account. Same command as the base email quickstart.

GNU Bashterminal.sh
npx @wraps.dev/cli email init

2
Install the SDK

Install @wraps.dev/email in the package where your agent code lives:

npm install @wraps.dev/email

3
Write the agent tool

Wrap wraps.emails.send() in a typed function. The same shape registers as a tool in any major agent framework.

TypeScriptsend-email-tool.ts
import { Wraps } from "@wraps.dev/email";const wraps = new Wraps();// The shape works for any agent framework.// LangGraph: register as a tool. Vercel AI SDK: pass to tool({}).// Mastra: wrap with createTool. The signature stays the same.export async function sendEmailTool(input: {  to: string;  subject: string;  html: string;}) {  const result = await wraps.emails.send({    from: "agent@yourdomain.com",    to: input.to,    subject: input.subject,    html: input.html,  });  if (!result.success) {    throw new Error(`Email failed: ${result.error.message}`);  }  return { messageId: result.data.messageId };}

Credentials

The SDK resolves AWS credentials from your environment — the same chain the AWS CLI uses. Your agent never sees an API key; it calls a function.

4
Give your AI editor Wraps docs

Add Context7 to your MCP config so Claude Code, Cursor, Windsurf, or any MCP-compatible editor can pull the latest Wraps docs into context. Prevents hallucinated APIs.

JSONmcp.json
{  "mcpServers": {    "context7": {      "command": "npx",      "args": ["-y", "@upstash/context7-mcp@latest"]    }  }}

Full setup (per-editor instructions, library IDs) in the Context7 guide.

Next Steps

Email SDK Reference

Every method, option, and response shape your agent can call.

View SDK Docs
CLI Commands

Manage, inspect, and destroy the infrastructure your agent uses.

View CLI Docs

Need Help?

Open an issue or join the GitHub discussions — we read every one.

Get Help