langchain-agentmail package provides LangChain tools for sending messages, replying inside a thread, managing drafts, downloading attachments, and labeling—all wired to a real AgentMail inbox.
Overview
Integration details
| Class | Package | Serializable | JS support | Version |
|---|---|---|---|---|
AgentMailToolkit | langchain-agentmail | ❌ | ❌ |
Available tools
| Tool | Description |
|---|---|
AgentMailListInboxesTool | List inboxes on the account |
AgentMailCreateInboxTool | Create a new inbox |
AgentMailListThreadsTool | List threads inside an inbox |
AgentMailGetThreadTool | Fetch a thread with its messages |
AgentMailListMessagesTool | List messages inside an inbox |
AgentMailGetMessageTool | Fetch a single message with its body |
AgentMailSendTool | Send a new email from an inbox |
AgentMailReplyTool | Reply inside an existing thread |
AgentMailUpdateMessageLabelsTool | Add or remove labels on a message |
AgentMailCreateDraftTool | Stage a draft (with optional send_at for scheduled delivery) |
AgentMailUpdateDraftTool | Revise an existing draft |
AgentMailSendDraftTool | Send a previously created draft |
AgentMailDeleteDraftTool | Permanently delete a draft |
AgentMailGetAttachmentTool | Get a presigned download URL for a message attachment |
Setup
Install the package:Credentials
You need an AgentMail API key. Sign up at agentmail.to to get one.Instantiation
Use the toolkit to get all tools at once:Invocation
Invoke directly with args
Invoke with ToolCall
Use within an agent
Drafts
The draft tools let an agent compose iteratively, revise, and ship—useful when a model wants to stage a message and confirm before sending, or schedule delivery viasend_at:
Attachments
Outbound attachments can be passed as base64 file content or as a public URL. Inbound attachments are fetched via presigned download URLs:API reference
For detailed documentation of the AgentMail API, visit docs.agentmail.to. The Python package source lives at github.com/agentmail-to/langchain-agentmail.Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

