Authorization: Bearer <org-api-key>. Both run agents and workflows, so the key needs the run permission on the project; a read-scoped key is refused.
MCP server
Point any MCP client (Claude, Cursor, an MCP SDK) at the project’s/mcp URL with the bearer header. The server lists:
ask_<agent>for every agent. Input{ message, sessionId? }. Returns the agent’s reply and asessionId; pass it back to continue the same conversation. AsessionIdthat belongs to another user is refused, like on the REST route.workflow_<slug>for every workflow, with the workflow’s input as the tool’s JSON Schema. Returns the workflow output.
runId (workflows) or sessionId (agents) with the route to read the result later: GET /workflows/<slug>/runs/<runId> or GET /agents/<agent>/sessions/<sessionId>.
When an agent pauses on a tool that needs human approval, the tool answers with the pending call and its approvalId instead of a reply. Approve or deny it in the web app, the CLI (luno agents approvals), or POST /agents/<agent>/sessions/<sessionId>/approvals/<approvalId>; the agent then finishes on its own.
Actions are not exposed directly. To publish one, wrap it in a workflow.
MCP client config
A2A server
Each agent has an A2A agent card. Itsurl is the agent’s JSON-RPC endpoint.
message/sendprompts the agent. The task’scontextIdis the agent session: send it back to continue the conversation. Another user’scontextIdis refused, andtasks/getdoes not find tasks in sessions you don’t own (project admins excepted). The call waits like the MCP tools; setconfiguration.blocking: falseto return at once.tasks/getreturns the task’s state:working,input-required(paused for approval),completed(the reply is inartifacts),failed, orcanceled.
tasks/cancel are not supported.
Call a remote A2A agent
defineA2AAgent turns a remote A2A agent into a tool for defineAgent({ tools }). Pass the agent card URL, or a base URL that serves /.well-known/agent-card.json.
src/agents/support.ts
message/send and, while the remote task is still working, polls tasks/get for up to timeoutMs (5 minutes by default). Its result includes the remote contextId, which the model passes back to continue the remote conversation.
Use a coding agent (ACP)
defineAcpAgent turns a coding agent that speaks the Agent Client Protocol (Claude Code, Codex, OpenCode, Gemini CLI…) into a tool. The process runs inside the agent’s sandbox, not on your machine.
src/agents/maintainer.ts
{ prompt }. The first call starts the process and runs ACP initialize and session/new; later calls in the same prompt reuse that session. Each call sends session/prompt and returns the coding agent’s reply plus the tool calls it made. A turn that runs past timeoutMs (10 minutes by default) or is aborted kills the process; the next call starts a fresh one. The process stops when the sandbox is disposed at the end of the prompt, so the coding agent’s session does not carry over to the next message.
permissionsanswers the coding agent’s permission requests:read-only(default) allows reads, searches, and fetches and rejects edits and commands;allow-allallows everything. Human approval of individual requests is not supported yet.cwdmust be under/workspace/agent(default) or/workspace/session.credentials+envresolve secrets into the process environment (in both sandbox modes). Other worker env stays out; in-process mode passes onlyPATH,HOME,USER,LANG,TMPDIR, andSHELL.- The sandbox must hold a long-lived process with open stdio. The default in-process sandbox and the local microsandbox VM (
defineSandbox({ mode: "vm" })withoutSPRITES_TOKEN/DAYTONA_API_KEY) can; Sprites and Daytona VMs cannot yet, and the tool fails with a clear error there. In-process mode runs the command on the worker host with the host filesystem (/workspace/agentmaps to the agent’s host directory), so prefer the microsandbox VM for anything you would not run on that machine.