npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agentmail-toolkit

v0.5.0

Published

AgentMail Toolkit

Downloads

7,599

Readme

AgentMail Toolkit

The AgentMail Toolkit integrates the AgentMail API with popular agent frameworks and protocols: the Model Context Protocol (MCP), the Vercel AI SDK, LangChain, and clawdbot. A framework-agnostic generic export is also available.

Setup

Get your API key from AgentMail

Installation

npm install agentmail-toolkit

Configuration

export AGENTMAIL_API_KEY=your-api-key

Usage

Each framework has its own subpath export. All tools share the same input/output schemas and descriptions - only the wrapping and error-signaling convention differs per framework, matching that framework's own idioms.

Vercel AI SDK (agentmail-toolkit/ai-sdk)

import { openai } from '@ai-sdk/openai'
import { AgentMailToolkit } from 'agentmail-toolkit/ai-sdk'
import { streamText } from 'ai'

const result = streamText({
    model: openai('gpt-4o'),
    messages,
    system: 'You are an email agent created by AgentMail that can create and manage inboxes as well as send and receive emails.',
    tools: new AgentMailToolkit().getTools(),
})

A failed tool call throws, which the AI SDK surfaces as a distinct tool-error part rather than a successful result.

MCP (agentmail-toolkit/mcp)

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
import { AgentMailToolkit } from 'agentmail-toolkit/mcp'

const server = new McpServer({ name: 'agentmail', version: '1.0.0' })
for (const tool of new AgentMailToolkit().getTools()) {
    server.registerTool(tool.name, tool, tool.callback)
}

Every tool declares an outputSchema and returns matching structuredContent alongside a JSON-stringified text block on success. On error, the result carries isError: true and an actionable text message instead of structured content.

LangChain (agentmail-toolkit/langchain)

import { AgentMailToolkit } from 'agentmail-toolkit/langchain'
import { createAgent } from 'langchain'

const agent = createAgent({
    model: 'openai:gpt-4o',
    tools: new AgentMailToolkit().getTools(),
})

A failed tool call throws, which LangChain propagates as a rejected tool run instead of a JSON-stringified success value.

clawdbot (agentmail-toolkit/clawdbot)

import { AgentMailToolkit } from 'agentmail-toolkit/clawdbot'

const tools = new AgentMailToolkit().getTools()

A failed tool call throws; clawdbot's agent loop catches it and marks the tool result as errored.

Generic (agentmail-toolkit)

import { AgentMailToolkit } from 'agentmail-toolkit'

const tools = new AgentMailToolkit().getTools()

Exposes each tool's name, description, paramsSchema, outputSchema, and a func for frameworks not covered above. A failed call throws a concise Error rather than the AgentMail SDK's raw, unbounded error dump.