Metadata-Version: 2.4
Name: crewai-agentmail
Version: 0.1.0
Summary: Official AgentMail integration for CrewAI
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: agentmail-to>=0.1.0
Requires-Dist: crewai>=0.80.0
Requires-Dist: httpx>=0.25.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"

# CrewAI + AgentMail

Official AgentMail integration for [CrewAI](https://github.com/crewAIInc/crewAI). Give your CrewAI agents real email inboxes — send, receive, reply, search, and organize emails as tools.

## Install

```bash
pip install crewai-agentmail
```

## Quick Start

```python
from crewai import Agent
from crewai_agentmail import AgentMailTools

# Initialize with API key (or set AGENTMAIL_API_KEY env var)
toolkit = AgentMailTools(api_key="am_live_...")

# Add all 11 tools to an agent
agent = Agent(
    role="Email Assistant",
    goal="Manage email communications",
    tools=toolkit.get_tools(),
)
```

### Create an Inbox & Send Email

```python
# Individual tools
from crewai_agentmail import CreateInbox, SendEmail

create = CreateInbox(api_key="am_live_...")
print(create._run(name="Support Agent"))  # → inbox ID + email

send = SendEmail(api_key="am_live_...")
print(send._run(to="user@example.com", subject="Hello", body="Hi there!"))
```

### Wait for Replies

```python
from crewai_agentmail import WaitForMessage

wait = WaitForMessage(api_key="am_live_...")
print(wait._run(inbox_id="inbox_123", timeout=120))
```

### Search & Label

```python
from crewai_agentmail import SearchMessages, CreateLabel, ApplyLabel

search = SearchMessages(api_key="am_live_...")
print(search._run(inbox_id="inbox_123", query="urgent"))

label = CreateLabel(api_key="am_live_...")
print(label._run(name="Follow-Up", color="#FF5733"))
```

## Environment Variables

| Variable | Description |
|---|---|
| `AGENTMAIL_API_KEY` | Your AgentMail API key. Optional if passed to constructor. |

## Available Tools

| Tool | Description |
|---|---|
| `CreateInbox` | Create a new email inbox |
| `SendEmail` | Send an email |
| `ListMessages` | List messages in an inbox |
| `GetMessage` | Get full message details |
| `ReplyToEmail` | Reply to a message |
| `ForwardEmail` | Forward a message |
| `WaitForMessage` | Long-poll for new messages |
| `SearchMessages` | Search messages by query |
| `CreateLabel` | Create an organizational label |
| `ApplyLabel` | Apply a label to a message |
| `DeleteInbox` | Delete an inbox permanently |

## Example

See [example.py](src/crewai_agentmail/example.py) for a full CrewAI crew with a Sales Rep agent that creates an inbox, sends outreach, waits for replies, and cleans up.

## License

MIT
