Connect OneLi to any agent
Pick a framework, copy the code, and run a sample call.
OneLi is a tool your agent calls: it sends a call task, OneLi makes the call in Hebrew and returns the transcript, questions during the call, and the result. Here is how it looks in each framework.
How it connects
Your agentMastra, OpenAI Agents, LangChain…
OneLiMCP or REST API
The businessA Hebrew phone call
Pick your agent
- 1An API key
Create one at oneli.io/app/connect and keep it in
ONELI_API_KEY. - 2InstallTerminal
npm i @mastra/core @mastra/mcp zod - 3ConnectTypeScript
import { MCPClient } from '@mastra/mcp' import { Agent } from '@mastra/core/agent' const mcp = new MCPClient({ id: 'oneli', servers: { oneli: { url: new URL('https://mcp.oneli.io/mcp'), // url => Streamable HTTP requestInit: { headers: { Authorization: `Bearer ${process.env.ONELI_API_KEY}` } }, }, }, }) export const callAgent = new Agent({ id: 'call-agent', name: 'Call Agent', instructions: 'Use OneLi to place and follow phone calls.', model: 'openai/gpt-5.6-sol', // any model id you use tools: await mcp.listTools(), // names are namespaced: oneli_create_call_task, … })
Run a sample call
- Queued
- Dialing
- Ringing
- On the call
- Done
Press “Run a sample call” to see what your agent sends and what OneLi returns, step by step.
A demo only: nothing is sent. The tool and event names are the real ones.
Next steps
Each framework’s code was checked against its docs on 22 October 2026. Model ids are examples: use the model you work with.