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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentmail_toolkit-0.3.0.tar.gz (194.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentmail_toolkit-0.3.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file agentmail_toolkit-0.3.0.tar.gz.

File metadata

  • Download URL: agentmail_toolkit-0.3.0.tar.gz
  • Upload date:
  • Size: 194.3 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for agentmail_toolkit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e82fe934f299d1b2f2b6137e4f286044653978fe7926571bdc8876d6a4776460
MD5 c16adf9dc93d5a9cfa7483df7f7d2aa8
BLAKE2b-256 2d41c6130e5c2659c86a368a5e7a29227542fc706c717929d5f0371084062ebc

See more details on using hashes here.

File details

Details for the file agentmail_toolkit-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: agentmail_toolkit-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for agentmail_toolkit-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc4215905017d0bf131006dfa2530f256984c1328140091a29c875dc548ab26e
MD5 7e325f3243ba0c3ecf7c158e3a33c621
BLAKE2b-256 5597a5bc8741f9353285411c8f90a137ed29769ec184f9f36e9702cef601f6b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page