New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@send0/langchain

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@send0/langchain

send0 tools for LangChain.js: give any agent an email inbox

latest
Source
npmnpm
Version
0.2.1
Version published
Weekly downloads
19
-94.89%
Maintainers
1
Weekly downloads
 
Created
Source

@send0/langchain

send0 tools for LangChain.js and LangGraph. Give an agent its own email inbox: sign up for things, read verification codes, and hold real email conversations.

npm install @send0/langchain @langchain/core zod

Usage

import { send0Tools } from "@send0/langchain";
import { createAgent } from "langchain";

const agent = createAgent({
  model: "anthropic:claude-opus-5-5",
  tools: send0Tools(), // reads SEND0_API_KEY
});

const result = await agent.invoke({
  messages: [
    { role: "user", content: "Create an inbox called signup-agent and tell me its address." },
  ],
});

send0Tools() returns an array of LangChain structured tools, so it also works with model.bindTools(...) and LangGraph's ToolNode. new Send0Toolkit(options).getTools() returns the same tools as a toolkit.

Tools

ToolWhat it doesKind
create_inboxMake a new address, e.g. signup-agent@send0.emailCreates
list_inboxesInboxes this key can useRead-only
wait_for_emailBlock until a matching email arrives; returns the code and link it extractedRead-only
search_messagesFull-text search, filter by sender (*@github.com) or directionRead-only
get_messageRead one message (new text only by default, to save tokens)Read-only
list_threadsConversations in an inbox, most recent firstRead-only
get_threadA whole conversation, oldest firstRead-only
send_emailStart a new threadSends
replyAnswer in the same threadSends

Options

send0Tools({
  apiKey: "s0_live_…", // default: process.env.SEND0_API_KEY
  baseUrl: "https://send0.example.com", // self-hosted send0
  client: new Send0(…), // or pass a configured @send0/sdk client
  inboxId: "ibx_…", // default inbox, so the model doesn't need inbox_id
  include: ["create_inbox", "wait_for_email"], // only these tools
  exclude: ["send_email", "reply"], // or everything but these
});

Approval

send_email and reply carry metadata.sends = true. To have a person approve them before they run, use LangChain's human-in-the-loop middleware (it needs a checkpointer):

import { createAgent, humanInTheLoopMiddleware } from "langchain";
import { MemorySaver } from "@langchain/langgraph";

const agent = createAgent({
  model: "anthropic:claude-opus-5-5",
  tools: send0Tools(),
  checkpointer: new MemorySaver(),
  middleware: [humanInTheLoopMiddleware({ interruptOn: { send_email: true, reply: true } })],
});

Or leave them out with exclude: ["send_email", "reply"]. An API key limited to one inbox, and an inbox with the approval send policy, are the safest setup for an agent.

Untrusted content

Email is written by strangers. Tools that return mail wrap each body in <untrusted_email> tags with a note to treat it as data, and messages send0 flags for prompt injection carry a visible warning. Don't give an agent that reads email tools it shouldn't be talked into using.

Errors

API errors are returned to the model as text, for example send0 error recipient_not_allowed: …, so it can recover instead of the run failing.

License

MIT

Keywords

email

FAQs

Package last updated on 13 Oct 2026

Related posts