- Delegation —
ask_creviohands the Crevio agent a job in plain English (“refund the last order from jane@…”, “write and schedule this week’s posts”) and returns the result. Longer jobs run in the background; you follow them as runs, continue the conversation, answer approval gates, and read the transcript. - Direct API —
api_searchandapi_executelet the connected agent discover and call every REST endpoint through code execution, with the same authorization and validation as the API.
New to Crevio’s agentic model? Start with the AI & Agents overview to see how MCP, Tasks, and Events fit together. Under the hood a delegated job is a Task with one run, so everything here is also visible in your dashboard and through
/v1/tasks and /v1/task_runs.Setup
1
Create an API token
In Crevio go to Settings → Developers → API tokens and create one. An MCP connection has exactly the permissions of the token behind it — everything the account can do.
2
Configure your client
Claude CodeClaude Desktop / Cursor / other clients — add to the client’s MCP config (Client-specific steps, OAuth, and raw
claude_desktop_config.json, ~/.cursor/mcp.json, …):curl examples are on the Connecting page.3
Verify with whoami
Ask the connected agent to call
whoami. It returns the account and user behind the token, the credential, plan, credit balance, rate limit, wait limits, and the list of tools — no arguments, no side effects. If whoami works, everything else will.Recommended workflows
One-off jobs: ask_crevio
The default. One call starts a run, waits up to timeout_seconds, and returns the run with the agent’s final reply in result.
timeout_secondsdefaults to 60 and is capped at 90. If the run is still going when it passes, the tool returnswait_timed_outwith the run — callwait_for_runwith itsidto keep waiting. Nothing is lost; the run continues on Crevio’s side.idempotency_keymakes retries safe: the same key returns the run the first call started instead of starting (and paying for) another.approval_modeisautonomousby default.supervisedmakes the run pause inneeds_inputfor your review before it finishes (finish it withsend_message, or let it stand);read_onlyforbids writes.
Long-running jobs: start_chat → wait_for_run → send_message
For anything you don’t want to block on — a site build, a research task, a bulk migration:
start_chatqueues the work and returns the run immediately.wait_for_run(bounded) orget_run(instant) untilstatusiscompleted,failed, orneeds_input.send_messagecontinues the conversation — follow-up instructions, corrections, answers to a question the agent asked. The agent keeps its context. On a finished run this starts a new run in the same conversation; on aneeds_inputrun it resumes it. Passtimeout_secondsto wait for the reply in the same call.resolve_approvalswhen a run is paused on an integration action (needs_inputwithpending_approval_ids) — approve or deny every pending id at once and the run resumes.cancel_runto stop a run that is pending, running, or waiting.
list_runs shows every run on the account — delegated jobs and your scheduled Tasks alike — while list_chats and get_chat browse the conversations themselves, and list_messages reads a chat’s full transcript, not just the final reply.
Direct API access: api_search + api_execute
When the connected agent wants to operate Crevio itself rather than delegate — or needs exact data shapes back — it drives the REST API in code. Rather than one tool per endpoint (403 operations across 280 paths would burn ~170k tokens of context before the agent did anything), Crevio uses Code Mode, inspired by Cloudflare’s approach: the agent writes code against two tools and chains as many calls as it likes in one round-trip.
- api_search
- api_execute
Read-only, idempotent discovery. A
tools method returns every operation as a hash with "method", "path", "summary", "description", "tags", "parameters", "request_body".api_execute dispatches through the same controllers as api.crevio.co, so the API conventions apply unchanged: params are unwrapped (no {product: {...}} wrapper), associations are bare names with prefix ids (product: "prod_abc", not product_id), money is in cents, list endpoints return {object: "list", data: [...]}, and a product needs a price variant before it can go active. A 404 resource_missing on a POST/PATCH is almost always a bad association id. Courses and other content live under /experiences, not /products.
Complete tool reference
Every MCP connection has the full permissions of its token, so every tool is available on every connection — there are no per-tool scopes to grant. Limit what an agent can do by giving it a token on an account whose data you’re happy for it to touch, and by choosing
approval_mode on delegated jobs.
The run object
Delegation tools return a run (trun_…), the same object as GET /v1/task_runs/:id plus result and chat_id:
Runs also fire the
task_run.completed, task_run.failed, and task_run.needs_input webhooks, and can be streamed over SSE at GET /v1/task_runs/:id/stream.
Errors
Authentication failures are HTTP401/403 on the request itself (WWW-Authenticate points at the OAuth metadata). Tool failures come back as a tool result with isError: true and a JSON body:
api_execute failures use the same envelope shape (error and no result) — a sandbox timeout, an exception in your Ruby, or an API error surfaced in calls.
Security
Every tool runs inside your account’s tenant boundary. Delegated jobs run the Crevio agent with the permissions your account already has;api_execute runs in a sandboxed Ruby VM (mruby — no filesystem, network, environment, or host primitives; 10-second timeout, 10 MB memory) and dispatches requests through the same API controllers as api.crevio.co, so authorization, validation, rate limiting, and error messages are identical to direct API calls. Tokens are as powerful as your account: only connect agents you trust, and revoke a token from Settings → Developers to cut a connection off instantly.
Next steps
Connecting
Client-by-client setup, OAuth, and curl examples.
Tasks (your AI workforce)
The Task / Task Run model every delegated job is built on — and how to schedule recurring work.
AI & Agents overview
How MCP, Tasks, and Events form Crevio’s agentic model.
API conventions
The shapes, prefixes, and gotchas
api_execute shares with REST.
