🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@multimail/ai-sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@multimail/ai-sdk

MultiMail tools for Vercel AI SDK — give any AI agent email capabilities

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@multimail/ai-sdk

MultiMail tools for the Vercel AI SDK. Give any AI agent the ability to send and read email through MultiMail.

Installation

npm install @multimail/ai-sdk ai zod

Quick Start

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { createMultiMailTools } from '@multimail/ai-sdk';

const tools = createMultiMailTools(process.env.MULTIMAIL_API_KEY!);

const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  maxSteps: 5,
  prompt: 'Check my inbox for unread emails and summarize them.',
});

Streaming

import { streamText } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
import { createMultiMailTools } from '@multimail/ai-sdk';

const tools = createMultiMailTools(process.env.MULTIMAIL_API_KEY!);

const result = streamText({
  model: anthropic('claude-sonnet-4-20250514'),
  tools,
  maxSteps: 5,
  prompt: 'Reply to the latest email from alice@example.com saying thanks.',
});

for await (const chunk of result.textStream) {
  process.stdout.write(chunk);
}

Tools

ToolDescription
listMailboxesList all mailboxes on the account
checkInboxList emails with filtering (status, sender, subject, direction, dates)
readEmailRead full email content (markdown body, attachments, tags)
sendEmailSend a new email with markdown body
replyEmailReply to an existing email (auto-threads)
searchContactsSearch contacts by name or email
listPendingList emails awaiting human approval
decideEmailApprove or reject a pending email
getThreadGet all emails in a conversation thread
tagEmailAdd key-value tags to an email

Configuration

const tools = createMultiMailTools('mm_live_...', {
  baseUrl: 'https://api-staging.multimail.dev', // optional: override API URL
});

Oversight Modes

MultiMail enforces graduated trust through oversight modes. Depending on the mailbox configuration, outbound emails may require human approval before delivery. The listPending and decideEmail tools let agents participate in the approval workflow.

Learn more at multimail.dev/docs.

License

MIT

Keywords

multimail

FAQs

Package last updated on 09 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts