LangChain tools for MultiMail — give your LangChain agents email capabilities
Project description
langchain-multimail
LangChain tools for MultiMail — give your LangChain agents email capabilities with graduated human oversight.
Installation
pip install langchain-multimail
Quick Start
from langchain_multimail import MultiMailToolkit
from langchain_openai import ChatOpenAI
from langchain.agents import create_tool_calling_agent, AgentExecutor
from langchain_core.prompts import ChatPromptTemplate
# Create tools
toolkit = MultiMailToolkit(api_key="mm_live_your_api_key")
tools = toolkit.get_tools()
# Create agent
llm = ChatOpenAI(model="gpt-4o")
prompt = ChatPromptTemplate.from_messages([
("system", "You are an email assistant. Use the MultiMail tools to help the user manage email."),
("human", "{input}"),
("placeholder", "{agent_scratchpad}"),
])
agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
# Run
executor.invoke({"input": "Check my inbox and summarize any new emails"})
Available Tools
| Tool | Description |
|---|---|
check_inbox |
List recent emails in a mailbox |
read_email |
Read the full content of an email |
send_email |
Send an email (held for approval if gated) |
reply_email |
Reply to an existing email thread |
search_contacts |
Search contacts by name or email |
list_pending |
List emails awaiting human approval |
decide_email |
Approve or reject a pending email |
get_thread |
Get all emails in a conversation |
tag_email |
Add key-value tags to an email |
Oversight Modes
MultiMail supports graduated oversight so your agent doesn't send unsupervised email:
gated_all— Agent drafts, human approves everythinggated_send— Agent reads freely, human approves outbound (default)monitored— Agent sends, human can review afterautonomous— Full agent control
When a mailbox uses gated oversight, send_email returns pending_send_approval and the email waits for human review. The agent can check status with list_pending.
Using Individual Tools
from multimail import MultiMail
from langchain_multimail import CheckInboxTool, SendEmailTool
client = MultiMail("mm_live_your_api_key")
inbox = CheckInboxTool(client=client)
sender = SendEmailTool(client=client)
# Use directly
print(inbox.run({"mailbox_id": "your_mailbox_id", "limit": 5}))
Links
- MultiMail — Homepage & docs
- multimail — Base Python SDK
- MCP Server — For Claude, Cursor, and other MCP clients
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_multimail-0.1.0.tar.gz.
File metadata
- Download URL: langchain_multimail-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c57b588c8a526d91d62bc928d92ac2c2519797d4a9b0fb39e8ee6c51e3412e66
|
|
| MD5 |
74e99d18ae2a9760506b552ad1942d38
|
|
| BLAKE2b-256 |
0ee2d0239d2ea11b17630b0cc9c3009d8e00704d22ba8d8d5d2a52016b081ab6
|
File details
Details for the file langchain_multimail-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_multimail-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02db978fc26125fb1b28586c8430993b9c17aefffd87d081b2021380e93277e8
|
|
| MD5 |
e99d1fe6619ea45823914afb3c332bc3
|
|
| BLAKE2b-256 |
bddc31518f434fe4b8450687c00afb363b5386edc31fc3d5a3e8deaaecb5446f
|