AgentMail Toolkit
The AgentMail Toolkit integrates popular agent frameworks including OpenAI Agents SDK, LangChain, and LiveKit Agents with the AgentMail API.
Setup
Get your API key from AgentMail
Installation
pip install agentmail-toolkit
Configuration
export AGENTMAIL_API_KEY=your-api-key
Usage
from agentmail_toolkit.openai import AgentMailToolkit
from agents import Agent
agent = Agent(
name="Email Agent",
instructions="You are an agent created by AgentMail that can send, receive, and manage emails.",
tools=AgentMailToolkit().get_tools(),
)
Errors
A failed tool call (an AgentMail API error, or any other exception) is surfaced
as a real failure, not a disguised success — each adapter raises the way its
framework expects: RuntimeError (OpenAI Agents SDK), ToolException
(LangChain, which becomes an error ToolMessage), or ToolError (LiveKit
Agents).
Attachment downloads
get_attachment's text extraction (PDF/DOCX) only follows https://
download URLs, applies a 15-second fetch timeout, and caps the downloaded
body at 25MB — attachments outside these bounds, or that fail to parse, are
returned without extracted text instead of raising.
Metadata
Release files for agentmail-toolkit 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentmail_toolkit-0.3.0.tar.gz | 194.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentmail_toolkit-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 203.3 kB
Release files / agentmail_toolkit-0.3.0.tar.gz
| Download URL | agentmail_toolkit-0.3.0.tar.gz |
|---|---|
| Size | 194.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e82fe934f299d1b2f2b6137e4f286044653978fe7926571bdc8876d6a4776460
|
|
BLAKE2b-256 checksum How to use checksums |
2d41c6130e5c2659c86a368a5e7a29227542fc706c717929d5f0371084062ebc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / agentmail_toolkit-0.3.0-py3-none-any.whl
| Download URL | agentmail_toolkit-0.3.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc4215905017d0bf131006dfa2530f256984c1328140091a29c875dc548ab26e
|
|
BLAKE2b-256 checksum How to use checksums |
5597a5bc8741f9353285411c8f90a137ed29769ec184f9f36e9702cef601f6b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|