---
agent:
  instructions: "Use this search API to find what Blueping's public pages say, with keywords or a question, instead of crawling them one by one. Results are returned in Markdown, best first, each with its link."
  endpoint: "https://blueping.dev/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

> The index of these docs for agents is at https://blueping.dev/llms.txt

# Give every CrewAI agent its own email address.

Each role of the crew writes from its own address, so vendors, customers and teammates answer the right agent.

crew.py:

```python
from crewai.tools import tool

import blueping_tools as bp


@tool("Send an email")
def send_email(inbox_id: str, to: str, subject: str, text: str) -> dict:
    """Send an email from the buyer's own inbox."""
    return bp.send_email(inbox_id, to, subject, text)
```

The function it wraps is in blueping_tools.py, in the setup below.

[Get an address](https://blueping.dev/signup.md) · [**Agents** /integrations/crewai.md](https://blueping.dev/integrations/crewai.md)

Blueping makes email inboxes for AI agents: one API call gives an agent its own address, with verification codes pulled out and every sender checked.

## Equip a CrewAI crew in two files

CrewAI's `@tool` decorator turns each Blueping call into a tool you give to the agents that need it. Each role can have its own address, so a crew emails vendors, customers and its own members in threads they all read.

### 1. What the crew's tools wrap

`blueping_tools.py` holds plain functions over the API, which read `BLUEPING_API_KEY` from the environment. The crew file below wraps two of them for the buyer.

blueping_tools.py:

```python
# blueping_tools.py: an inbox for your agent, in five functions. Python 3.9+, no dependency.
import json, os, urllib.error, urllib.parse, urllib.request

API = "https://blueping.dev/v1"


def call(method, path, body=None):
    request = urllib.request.Request(
        API + path, method=method,
        data=json.dumps(body).encode() if body is not None else None,
        headers={"Authorization": "Bearer " + os.environ["BLUEPING_API_KEY"],
                 "Content-Type": "application/json", "User-Agent": "my-agent/1.0"})
    try:
        with urllib.request.urlopen(request, timeout=90) as response:
            return json.load(response)
    except urllib.error.HTTPError as error:
        return json.load(error)  # {"error": {"code", "message", "next_action"}}


def create_inbox(username: str) -> dict:
    """Create an email inbox, username@blueping.dev, that receives at once."""
    return call("POST", "/inboxes", {"username": username, "client_id": username})


def wait_for_code(inbox_id: str, sender: str = "") -> dict:
    """Wait up to 50 seconds for the next verification code or sign-in link."""
    query = urllib.parse.urlencode({"wait": 50, **({"from": sender} if sender else {})})
    return call("GET", f"/inboxes/{inbox_id}/code?{query}")


def read_inbox(inbox_id: str) -> dict:
    """The newest mail of an inbox, as JSON, with held mail counted."""
    return call("GET", f"/inboxes/{inbox_id}/messages?limit=10")


def send_email(inbox_id: str, to: str, subject: str, text: str) -> dict:
    """Send an email from the inbox."""
    return call("POST", f"/inboxes/{inbox_id}/messages", {"to": to, "subject": subject, "text": text})


def reply(message_id: str, text: str) -> dict:
    """Answer an email in its own thread."""
    return call("POST", f"/messages/{message_id}/reply", {"text": text})
```

### 2. The crew

The decorator's name is what the agent sees; the docstring tells it when to use the tool.

crew.py:

```python
from crewai import Agent, Crew, Task
from crewai.tools import tool

import blueping_tools as bp


@tool("Send an email")
def send_email(inbox_id: str, to: str, subject: str, text: str) -> dict:
    """Send an email from the buyer's own inbox."""
    return bp.send_email(inbox_id, to, subject, text)


@tool("Read the inbox")
def read_inbox(inbox_id: str) -> dict:
    """The newest email in the buyer's inbox, as JSON."""
    return bp.read_inbox(inbox_id)


buyer = Agent(role="Buyer", goal="Get three quotes for 40 office chairs",
              backstory="You email vendors from your own inbox.", tools=[send_email, read_inbox])
task = Task(description="Ask vendors@lumen.example for a quote, using inbox inb_...",
            expected_output="The email sent, and any answer so far.", agent=buyer)
print(Crew(agents=[buyer], tasks=[task]).kickoff())
```

Checked against [CrewAI docs, tools](https://docs.crewai.com/en/concepts/tools) on November 22, 2026.

## What a CrewAI crew does with its own inbox

### A crew with one address per role

The researcher subscribes to the sources, the buyer writes to vendors and the writer sends the report: three inboxes, one per agent, each made with `create_inbox`.

### Members that email each other

Mail between two Blueping inboxes arrives with its sender verified, so the crew can hand work over by email and keep the thread as its record.

## Before you connect CrewAI

- Each tool returns the API's JSON, so an agent sees `held` mail counted and a refusal's `next_action`.

### Should every CrewAI agent have its own inbox?

When it talks to people outside the crew, yes: replies come back to the agent that wrote, and each thread stays with its role.

## Build more with CrewAI

- [**Quotes and purchase orders** The agent sends a request for quote to approved suppliers, compares the quotes, and drafts the purchase order for a person to send.](https://blueping.dev/use-cases/procurement.md)
- [**Multi-agent systems** Each agent gets its own address, tasks travel as emails in threads, and mail between Blueping inboxes arrives at once.](https://blueping.dev/use-cases/multi-agent-email.md)
- [**Recruiting** Applications reach the agent's address; it reads each résumé, asks the role's questions and moves candidates through the stages.](https://blueping.dev/use-cases/recruiting.md)
- [**Mastra** createTool definitions given to a Mastra Agent.](https://blueping.dev/integrations/mastra.md)
- [**LlamaIndex** Plain functions given to a FunctionAgent.](https://blueping.dev/integrations/llamaindex.md)
- [**Pydantic AI** The hosted MCP server as a toolset, with your key in the headers.](https://blueping.dev/integrations/pydantic-ai.md)

[All integrations](https://blueping.dev/integrations.md) · [The quickstart](https://blueping.dev/docs.md) · [API reference](https://blueping.dev/docs/api.md) · [Every MCP client](https://blueping.dev/agents.md)
