Skip to main content

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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentmail-toolkit 0.3.2
File Size Uploaded
agentmail_toolkit-0.3.2.tar.gz 256.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentmail-toolkit 0.3.2
File Interpreter ABI Platform
agentmail_toolkit-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 267.9 kB

Release files / agentmail_toolkit-0.3.2.tar.gz

Download URL agentmail_toolkit-0.3.2.tar.gz
Size 256.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3eeb4edd98c9950344644e156b25d3960a8e346db2a40ba4f1e60c1f75fa4f95
BLAKE2b-256 checksum
How to use checksums
730c84b07694bfdec4e27e4f72d156cd81f7201aafadcc71d6ee95804b2b3ae6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / agentmail_toolkit-0.3.2-py3-none-any.whl

Download URL agentmail_toolkit-0.3.2-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07e76e95b31f296da0234365fdd30c36d2e3ba7128e881b7468848a277b99a6f
BLAKE2b-256 checksum
How to use checksums
9877d9b21ed33fcdd79d27e75c220b52a77dc75677c6be12a7dfd7d3ec0df882
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.0

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.35

2 release files

0.1.34

2 release files

0.1.32

2 release files

0.1.31

2 release files

0.1.30

2 release files

0.1.29

2 release files

0.1.28

2 release files

0.1.27

2 release files

0.1.26

2 release files

0.1.25

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page