עבריתLog in

OneLi with CrewAI

How to let an agent built with CrewAI place Hebrew phone calls through OneLi, follow the call, answer consultations and read the result.

In CrewAI, pass an MCPServerHTTP with an Authorization header to the agent through mcps.

Setup

  1. Create an API key at oneli.io/app/connect and store it on the server as ONELI_API_KEY.
  2. Install the packages:
Terminal
uv add crewai mcp   # adapter: uv pip install 'crewai-tools[mcp]'

Checked against: crewai 1.15.28 · crewai-tools 1.15.28

Connect over MCP (recommended)

Python
import os
from crewai import Agent, Task, Crew
from crewai.mcp import MCPServerHTTP

agent = Agent(role="Phone assistant", goal="Place calls with OneLi", backstory="…",
    mcps=[MCPServerHTTP(url="https://mcp.oneli.io/mcp",
                        headers={"Authorization": f"Bearer {os.environ['ONELI_API_KEY']}"},
                        streamable=True, cache_tools_list=True)])
Crew(agents=[agent], tasks=[Task(description="Call +972… and book a table", expected_output="Call result", agent=agent)]).kickoff()

# Adapter (headers work per source, undocumented); ALWAYS set transport, the default is "sse":
# from crewai_tools import MCPServerAdapter
# with MCPServerAdapter({"url": "https://mcp.oneli.io/mcp", "transport": "streamable-http",
#                        "headers": {"Authorization": f"Bearer {key}"}}) as tools: Agent(..., tools=tools)

Notes

  • The DSL docs show plain string URLs with auth in query parameters. Use MCPServerHTTP to send a header.
  • With MCPServerAdapter always set transport: the default is sse.
  • Tool schemas are cached for 5 minutes.
  • REST tool: @tool("create_call_task") from crewai.tools on a function that sends the POST and returns r.text.

Phone numbers: OneLi accepts an Israeli number in any common format (050-1234567, +972501234567). Once the call starts, the agent follows it with get_call_events or GET /v1/call-tasks/:id/events to answer consultations and get the summary.

Next steps

Sources: docs.crewai.com/en/mcp/dsl-integration · docs.crewai.com/en/mcp/streamable-http