On this page

#Tools

Tools let the agent call your APIs. A tool is one HTTP request. Your coding agent adds or replaces one with set_tool on the Vatio MCP, passing the tool's fields as arguments: name, which is the tool's key (check_stock), description, when_to_use, parameters, access, request, respond, async, follow_ups, approval and attach. Each call replaces the whole tool. get_agent returns every tool as JSON, in those same fields, and remove_tool deletes one. The examples on this page are set_tool arguments.

set_tool argumentWhat it is
nameThe tool's key: lowercase letters, digits, - or _. Required
descriptionWhat the tool does, as the agent reads it
when_to_useWhen the agent should call it. Defaults to description
parametersA JSON Schema object: type: object, properties, required
accessWho it may act for: see Access. public when left out
requestThe HTTP call: method, path, and optionally base_url, headers, query, body, requires, timeout, cache. Required
respondWhat the agent gets back: data, message, buttons. See Response mapping
asyncFor work over 30 seconds: see A tool that takes longer
follow_upstrue lets the backend's answer schedule follow-ups: see Follow-ups
approvalby, ask, timeout: wait for a person's yes. See Approval
attachfalse saves the tool without giving it to the agent. true when left out

Anything that needs branching, a second call, or a derived response is code, and it belongs in the backend the tool already calls — give the agent one endpoint that does the whole job.

A tool runs only when its key is in the agent's tools. set_tool adds it there; with attach: false the tool is saved but the agent is not given it until an update_agent call lists it.

#Tools or knowledge

Knowledge is for what changes slowly: policies, hours, how a service works. Tools are for what is true right now (stock, an order's status, free slots) and for anything that does something, such as booking. Without a tool, an agent asked about stock either says it does not know or guesses. Your backend stays the source of truth and keeps doing the checks; Vatio runs the conversation and makes the call.

How a tool runs:

  1. The agent reads description and when_to_use, decides to call the tool, and fills parameters.
  2. Vatio builds the request, replaces the placeholders and sends it from its own servers.
  3. respond picks what the agent sees, and the agent writes its reply from result: ok or result: error.

In the inbox, every call shows next to the reply it produced.

A tool runs inside the agent's turn and answers in seconds. Work that takes minutes and changes your code goes to a Claude Code routine that your backend starts: see the guide.

#Declarative HTTP tools

Set your backend URL as a workspace secret, with set_secret:

{ "workspace": "acme", "key": "ACME_API", "secret_value": "https://api.acme.com" }

Tools read secrets as $env.KEY, a change applies to the next call, for everyone at once, and list_secrets shows names, never values. A secret has one value everywhere, plus an optional test value ("tests": true) that your team's conversations with the agent and every test run use instead, like a staging API. Your coding agent takes a value from where you keep it, such as the app's .env, and does not repeat it back. To type a key in yourself without it passing through a chat, use Settings → Secrets in the inbox. Secrets has the rest.

Then set_tool with these arguments. The tool expects the API to return {"data": [{"name": "Picker", "stock": 3}]}:

{
"workspace": "acme",
"name": "check_stock",
"description": "Check product stock.",
"when_to_use": "The visitor asks whether a product is available.",
"parameters": {
"type": "object",
"properties": {
"product": { "type": "string" }
},
"required": ["product"]
},
"access": "public",
"request": {
"method": "GET",
"base_url": "$env.ACME_API",
"path": "/products",
"query": { "name": "$params.product" }
},
"respond": {
"data": { "products": "$.data" },
"message": {
"when_empty": "No products matched that name.",
"default": "Found {{count}} matching products."
}
}
}

set_tool gives the agent the tool. Say when to use it in the agent's instructions too, with update_agent: "Use check_stock to answer questions about product availability."

parameters is a JSON Schema object. The agent is shown each property's type and description, the enum of a string, an array's items, and the properties and required of an object, an array's items included (so an items array of {product_id, quantity} objects reaches the agent with both fields); other keywords, such as minimum or format, are not shown to it, so say limits like those in the description too. The one format Vatio reads is vatio-attachment, for a file the visitor sent.

Vatio holds every argument to what you declared before the call goes out, at every level of the schema, so your API only gets calls that fit it:

  • It checks required, type and a string's enum, in objects and in an array's items too, and additionalProperties: false, minimum/maximum, minLength/maxLength and minItems/maxItems.
  • A value that is only written differently goes out as declared: "54" or 54.0 for an integer as 54, "true" for a boolean as true, a number for a string as text, one object where an array is declared as a list of one, and a string enum value that differs only in case, accents or surrounding spaces as the declared value (Limpieza as LIMPIEZA, jardinería as JARDINERIA).
  • Anything else never reaches your API. It goes back to the agent as an invalid_argument error that names the field (items[0].product_id) and what it takes, and the agent calls the tool again.

Other keywords, such as format or pattern, are not checked: your API still has the last word on those.

set_tool and the inbox warn about any key in parameters that is not JSON Schema, a type that is not one of its types, a property written without a schema, and a required name that is not among the properties.

The fields of request:

FieldWhat it is
methodGET, POST, PUT, PATCH or DELETE
base_urlScheme and host, and optionally a path of its own. Required here or in the shared one set_backend sets
pathAppended to base_url. Required
headersA map of header names to values
queryA map of query string parameters
bodyA JSON map, sent with POST, PUT and PATCH
requiresValues the call cannot go out without: see Required values
timeoutSeconds the call waits for your backend's answer: 8 when left out, 1 to 30. See Timeout
cacheHow long a GET's answer is reused, such as 10m. See Cache an answer

A path is appended to the base URL: a base_url of https://<ref>.supabase.co/functions/v1 and a path of /my-tools/check_stock call https://<ref>.supabase.co/functions/v1/my-tools/check_stock. A path that already starts with the base URL's path is not prefixed twice. A query or body key whose value is null sends the parameter of the same name: "date": null is "date": "$params.date".

#Shared base URL and headers

When every tool calls the same backend, set its base_url and headers once, with set_backend:

{
"workspace": "acme",
"base_url": "$env.ACME_API",
"headers": { "Authorization": "Bearer $env.ACME_API_KEY" }
}

Each field given replaces the one there, headers as a whole, and an empty one removes it. get_agent shows it as request. Every tool starts from it. A tool's own base_url replaces the shared one, and its headers are added to the shared ones, a header of the same name replacing the shared header. Only base_url and headers can be shared.

The call goes out from Vatio's servers, so it has to reach a public http or https address. A host that is or resolves to a private, loopback or link-local address (localhost, 10.x, 192.168.x, 169.254.169.254, a .internal name) is refused and the tool fails as unreachable, with the reason in get_tool_health. To call a backend running on your machine, expose it through a tunnel with a public URL.

#Access

access says who the tool may act for:

accessWho gets the tool
public, or left outAnyone the agent talks to
privateA signed-in visitor, verified by your JWT: see Private tools
supervisorThe team, a developer or the owner of the workspace
developerA developer or the owner
ownerThe workspace owner only: for what only they should do from WhatsApp, such as confirming a payment

The three team values are a minimum role, and each includes the roles above it (Teams). A member who still has the old read-only viewer role never gets one. These tools are how the business runs things from WhatsApp: updating stock or prices, confirming a payment, reading the day's orders. No tool is for the team by default, because a tool without access is public, so set the role you mean.

A team role is checked from the WhatsApp number the person verified on their own account page (Account in the inbox), in a WhatsApp conversation. The number is the one WhatsApp delivered the message from, so nothing typed in the chat makes someone a team member, and no other channel has one. A tool for a role is hidden from everyone else, not refused: the agent is not shown how to call it, and a call that names it anyway is refused. In a conversation with a team member the agent is also told it is talking with the business.

Your instructions name these tools for the team's sake, so the agent is told which of them this person cannot use. When someone without the role asks for what they do, even saying they work for the business, the agent says plainly that it cannot be done from that conversation, and never that it did it or noted it down.

To try these tools, a team member writes from their own verified number, to your own number or to Vatio's shared number. A customer phone is a customer. The team and their numbers are listed, read-only, on the inbox's WhatsApp page and by the MCP's list_team (whatsapp, the owner's) (The team on WhatsApp); see Teams for the roles.

Your endpoint is on the internet, so it still checks: send $contact.phone_number with a secret of yours, and refuse a number that is not the business's. Or send $chat.team_role with the secret, and let each role do what it may: the team stays one list, Vatio's, and someone the team adds from WhatsApp (team_members) reaches your backend with no change on your side. The value comes from Vatio, never from the chat, so only the secret has to be checked.

{
"workspace": "acme",
"name": "set_stock",
"description": "Sets how many of a product are left.",
"when_to_use": "The business says how many of something it has, or that it ran out.",
"parameters": {
"type": "object",
"properties": {
"product_id": { "type": "integer" },
"stock": { "type": "integer" }
},
"required": ["product_id", "stock"]
},
"access": "supervisor",
"request": {
"method": "PATCH",
"base_url": "$env.STORE_API",
"path": "/owner/products/$params.product_id",
"requires": ["contact.phone_number"],
"headers": { "Authorization": "Bearer $env.STORE_API_KEY" },
"body": {
"phone": "$contact.phone_number",
"stock": null
}
}
}

#Placeholders

Values in base_url, path, headers, query, and body support:

PlaceholderSource
$params.<name>Tool arguments; $params.<name>.<field> for a field of an object argument
$env.<KEY>Workspace secrets
$auth.subject, $auth.token, $auth.claims.<key>The tool's authenticated principal
$contact.name, $contact.email, $contact.phone_numberContact profile
$chat.id, $chat.urlThe conversation, and its link in the inbox
$chat.channelWhere the visitor is writing: whatsapp, instagram, instagram_comments (a post's public comment thread), ios, android, widget, web or cli
$chat.environmentlive (a customer's conversation, with the version everyone has) or preview (your team's, with the newest version)
$chat.team_roleThe role on the team of whoever is writing: supervisor, developer or owner, and empty for everyone else (Access)

A single placeholder keeps its value's type. A placeholder within a string is interpolated. A query or body key whose value is null is $params.<that key>. || selects the first non-empty alternative, such as "$params.name || $contact.name".

$chat.channel lets one endpoint answer differently in your own app than on WhatsApp, such as scoping a lookup to the account open in the app. whatsapp, instagram and instagram_comments come from Meta and cannot be faked. ios and android come from the Origin your app sends, and a client that is not a browser can send any Origin, so use the channel to narrow an answer, never to grant access.

#Visitor files

A tool can send your backend a photo, PDF or other file the visitor sent in the conversation, such as a ticket that carries the screenshot of the problem. Declare the parameter with format: vatio-attachment, a string for one file or an array of them for several:

{
"workspace": "acme",
"name": "create_ticket",
"description": "Open a support ticket with the team.",
"when_to_use": "The visitor reports a problem the team has to fix.",
"parameters": {
"type": "object",
"properties": {
"summary": { "type": "string", "description": "The problem, in one sentence." },
"screenshot": {
"type": "string",
"format": "vatio-attachment",
"description": "The photo that shows the problem, if they sent one."
}
},
"required": ["summary"]
},
"access": "public",
"request": {
"method": "POST",
"base_url": "$env.ACME_API",
"path": "/tickets",
"requires": ["chat.url"],
"body": {
"summary": null,
"screenshot": null,
"chat_url": "$chat.url"
}
}
}

The agent picks the file, and Vatio sends it. Each file the visitor sent comes with its attachment id in the conversation history, and the agent puts that id in the parameter. Vatio replaces it with:

{ "id": "8123", "url": "https://...", "filename": "IMG_0412.jpg", "content_type": "image/jpeg", "byte_size": 184233 }

An array parameter gets a list of these. To send only one field, name it: "$params.screenshot.url".

  • Only files the visitor sent in this conversation. An id from another conversation, a file the agent or your team sent, or a URL the agent wrote goes back to the agent as an invalid_argument error, so it can call the tool again. The request is not sent.
  • The link expires after 1 hour. Download the file when the call arrives and store it on your side. Don't save the link in a ticket, because it will stop opening.
  • Every file sent is on the Activity page, as "The agent sent a visitor's file to a tool", with the conversation and the tool.
  • Instagram files Vatio did not download, such as a large video left at Meta, have no id and cannot be sent.
  • In an eval replay the visitor's files are not there. The call goes out without the parameter, or gets the answer from the original turn when the replay makes the same call.

Agents without a tool like this get no attachment ids in their history.

#Required values

Missing values are omitted from the request. A parameter listed in parameters.required is never sent missing: when the agent leaves it out or empty, the request is not sent and the agent gets an invalid_argument error naming it, so it can call the tool again. false and 0 are values.

Any other value the endpoint needs, such as the contact's phone, goes under request.requires, without the $ prefix, to fail before sending an incomplete request. A missing contact phone, email, or name produces missing_contact_phone, missing_contact_email, or missing_contact_name; other paths produce missing_requirement. A params.NAME there that parameters.required already lists adds nothing, and saving the tool warns with the edit that removes it.

On WhatsApp, a tool can count on $contact.phone_number. It comes with the message; a visitor who hides their number behind a WhatsApp username is sent a message with a one-tap button to share it the first time a tool that requires contact.phone_number runs, and that message is the agent's reply for the turn. The number arrives with their next message, and the tool runs then. You do not need request_contact_info for this.

Anywhere else, $contact.phone_number comes only from the visitor's sign-in: the phone_number claim of your identity token. A number the visitor types in the chat is never used, so nobody can pass for someone else by typing theirs. On missing_contact_phone there, the agent is told not to ask for the number and to say this cannot be done from that chat.

An eval replay talks as the workspace's test contact, normally your verified WhatsApp: its $contact.phone_number is that number, so a backend that identifies people by phone answers as you.

#Response mapping

respond.data maps output keys to JSON paths: $ is the entire body, $.data is its data field. respond.message can be a literal string or the when_empty / default mapping shown above. {{count}} is the length of the first array in the mapped data. Without an array, when_empty applies when all mapped values are blank.

Omit respond.message to use the API's own message field. HTTP 2xx produces result: "ok"; non-2xx produces result: "error", so return the status that says what happened rather than encoding failures inside a 200.

On a 2xx, the agent sees only result, the message and the keys respond.data maps: nothing else from the body. A tool with no respond at all gets result: "ok" and the body's message, which is empty when the backend sends none, so the agent cannot tell what the call found. Map what the reply needs with respond.data ($ passes the whole body), or have the backend return a message that says it.

respond.buttons lists the respond.data keys whose URL goes out as a button instead of as text, the way a button: true link does:

{
"respond": {
"data": {
"professional": "$.data.name",
"booking_url": "$.data.booking_url"
},
"buttons": ["booking_url"]
}
}

The agent finds those URLs in the result's button_urls and gives one as a Markdown link with its own text, so the button can name what the result returned ("Book with Ana"). A key can hold one URL or a list of them; a value that is not an http or https URL is left as text, and an error result has no buttons. set_tool refuses a key in buttons that respond.data does not map.

On a non-2xx, the agent gets the body's message and error_key, every other top-level field as it is, such as a hint, and the response's http_status. A body with no message but a string error ({ "error": "...", "hint": "..." }) uses error as the message. With neither, the message only gives the HTTP status. A body with no error_key gets unexpected_http_status, so give a status you return on purpose its own key:

{ "message": "This number has no account. Sign up at https://example.com.", "error_key": "account_not_found" }

The error_key is for the agent and for you; it changes nothing else. With or without it, a 4xx you return on purpose (any but 401, 407, 408 and 429) reads as an answer in a report's diagnosis, under Your agent (Improve), and get_tool_health counts every non-2xx as a failed call in its error rate.

#A tool that acts

A tool that changes something in your backend is a POST with a body. || takes the first value that is not empty: what the customer just said, or what the contact profile already holds.

{
"workspace": "acme",
"name": "book_service",
"description": "Book a workshop service for the customer's bike.",
"when_to_use": "The customer chose a service and a day, and confirmed their name.",
"parameters": {
"type": "object",
"properties": {
"service": { "type": "string", "description": "e.g. brake tune-up, full service" },
"date": { "type": "string", "description": "YYYY-MM-DD" },
"name": { "type": "string" },
"phone": { "type": "string", "description": "Instagram and web only. On WhatsApp the tool uses the contact's number" }
},
"required": ["service", "date"]
},
"access": "public",
"request": {
"method": "POST",
"base_url": "$env.ACME_API",
"path": "/service-bookings",
"headers": { "Authorization": "Bearer $env.ACME_API_KEY" },
"body": {
"service": null,
"date": null,
"name": "$params.name || $contact.name",
"phone": "$params.phone || $contact.phone_number"
}
},
"respond": {
"data": { "booking": "$.booking" }
}
}

"required": ["service", "date"] makes the tool fail before sending half a booking. On WhatsApp the profile already has the customer's phone number, so the agent asks for it only on Instagram and the web. A tool used only on WhatsApp can skip the parameter: send $contact.phone_number and list contact.phone_number under requires.

#Calls at the same time

When the agent needs several lookups that do not depend on each other, such as availability on three dates, it asks for them together, and Vatio calls your backend for all of them at once: up to 4 requests at the same time, from one conversation. Your endpoint should handle concurrent requests, as it would from any client. Calls to Vatio's own tools still run one after another.

#Timeout

A call waits 8 seconds for your backend to answer. After that it fails as a timeout, and the agent is told the tool could not be reached. A backend that is right but slow, such as a public API that takes 12 seconds, gets more time with timeout, in seconds, from 1 to 30:

{
"request": {
"method": "GET",
"base_url": "$env.RATES_API",
"path": "/rates/today",
"timeout": 20
}
}

The person waits for the reply while the call runs, with the typing indicator up on WhatsApp and Instagram, so keep it as short as your backend allows. Two ways to wait less:

  • A GET whose answer is the same for whoever asks can be cached: only the first call waits.
  • Work that takes longer than 30 seconds, or that is often slower than a few, is an async tool: your backend accepts the job at once and posts the result when it has it.

#Cache an answer

A GET whose answer is the same for whoever asks, such as today's exchange rate, a price list or the opening hours your backend keeps, can be reused instead of asked again on every call. cache says for how long: 90s, 10m, 2h or 1d, a day at most.

{
"workspace": "acme",
"name": "exchange_rate",
"description": "Today's exchange rate from a currency to Chilean pesos.",
"when_to_use": "The visitor asks what a currency or the UF is worth in pesos.",
"parameters": {
"type": "object",
"properties": {
"currency": { "type": "string", "enum": ["USD", "EUR", "UF"] }
},
"required": ["currency"]
},
"access": "public",
"request": {
"method": "GET",
"base_url": "$env.RATES_API",
"path": "/rates/$params.currency",
"timeout": 20,
"cache": "1h"
},
"respond": {
"data": { "rate": "$.data" }
}
}
  • One answer per request. The answer is kept for the request exactly as it went out: the URL with its query, and the headers with your secrets' values in them. USD and EUR are two requests, and a secret changed with set_secret makes a new one. Your team's conversations and your customers' keep their own, and a change to the tool starts over.
  • Only a 2xx that is JSON is kept. An error, a timeout, a body that is not JSON or one over 256 KB is not, so the next call asks your backend again.
  • Only a request that is the same whoever asks. A cached answer goes to whoever calls next, so saving a tool refuses cache on one that is not a GET, is async, has an access other than public, takes a visitor's file, or whose request uses $contact.*, $auth.* or $chat.* or lists one of them under requires. That includes the shared headers set_backend sets: give the tool its own header of the same name to replace one that uses them. $params.* and $env.* are fine: they are part of the request.
  • Said where you look. A call answered from the cache is marked as such in get_conversation, and get_tool_health counts it under Cached and leaves it out of the error rate and the latencies: your backend was not called.
  • Kept encrypted, like what your backend answers to any call.
  • Eval replays skip it and ask your backend, so a fix there shows at once.

#A tool that takes longer: async

A call waits for its timeout, 30 seconds at most. Work that takes longer (a recommendation that writes a text per result, a report, a job that drives a browser for minutes) goes in an async tool: your backend accepts the job at once, and posts the result when it has it.

Visitor on any channel Vatio and your agent one conversation Your backend the async tool's endpoint "Find me a therapist for anxiety" POST /vatio/match + job id, callback URL 202 Accepted "I'm on it, I'll write here" JOB RUNNING seen in every turn POST callback {progress} "How is it going?" "Still on it: 12 to go" POST callback {result, data} 200 Written as the tool's answer a turn of its own gives it "Here are two therapists near you…" cancel: called off or timed out
The life of an async tool's job: accepted at once, known to the agent while it runs, delivered as the tool's answer when your backend posts it.

The whole task, with a backend to copy from, is the guide Long-running tools.

{
"workspace": "acme",
"name": "match_profesional",
"description": "Finds recommended psychologists for the patient's reason and area.",
"when_to_use": "The patient told you why they want help and where they live.",
"parameters": {
"type": "object",
"properties": {
"motivo": { "type": "string" },
"comuna": { "type": "string" }
},
"required": ["motivo", "comuna"]
},
"async": {
"timeout": "10m",
"cancel": {
"method": "DELETE",
"path": "/vatio/jobs/$job.id"
},
"whatsapp_template": {
"name": "resultado_listo",
"language": "es",
"params": ["$contact.name"]
}
},
"request": {
"method": "POST",
"base_url": "$env.CLINIC_API",
"path": "/vatio/match",
"body": {
"motivo": null,
"comuna": null
}
},
"respond": {
"data": { "profesionales": "$.data.profesionales" }
}
}

The fields of async, all optional ("async": {} takes the defaults):

FieldWhat it is
timeoutHow long the job may run: 1m to 8h, 10m when left out
cancelThe request Vatio sends when the job is called off or times out: method (DELETE, POST, PUT or PATCH), path, and optionally base_url, headers, query, body
whatsapp_templateThe template that brings the visitor back when WhatsApp's 24-hour window has closed: name, language, params. A param is $contact.name, $result.message or fixed text
  1. Vatio calls your endpoint as it calls any tool, adding the job's id and where to send its result: the headers X-Vatio-Job-Id, X-Vatio-Callback-Url and X-Vatio-Job-Expires-At, and the placeholders $job.id, $job.callback_url and $job.expires_at for the body, query or path.

  2. Your endpoint answers 202 within the tool's timeout (8 seconds unless it sets one) and starts the work. Any other answer is the result, as for any tool, and there is no job: an endpoint that sometimes has the answer ready can answer 200.

  3. The agent is told the job started, tells the visitor it is on it, and ends its turn. Until the job ends, every turn knows it is running: the agent does not start it again, answers "¿cómo va?" with the latest progress, and calls it off (the built-in cancel_background_job) if the visitor no longer wants it. A conversation runs up to 5 jobs at once.

  4. Your backend posts the result to the callback URL. The body is what the endpoint would have answered at once, read through respond the same way. "result": "error" ends the job as failed, and the agent relays your message.

    Terminal window
    curl -X POST "$CALLBACK_URL" -H "Content-Type: application/json" \
    -d '{"result":"ok","message":"2 found","data":{"profesionales":[…]}}'
  5. Vatio writes the result into the conversation as that tool's answer and wakes the agent to give it, on whatever channel the conversation is: the widget and the iOS and Android SDKs (at once, and in the history when the app opens again), WhatsApp and Instagram. If the visitor wrote in the meantime, the reply to their message gives it. Later turns read it like any tool result, so "¿y el segundo atiende online?" is answered from it.

Before the result, the same URL takes progress: {"progress": "Revisando 12 profesionales"} is kept for when the visitor asks, and with "notify": true the agent passes it on right away.

Callback answerMeans
200Result taken. The same result sent again also gets 200 ("duplicate": true), so retry until you get one
202Progress taken
409 job_closedThe job already ended: it timed out or was called off. Stop retrying
404 unknown_jobThe URL is not one Vatio issued, or it expired a day after the job's timeout
413 result_too_largeThe body is over 32 KB

The URL is the credential: it names one job, signed, and needs no key. Treat it like one and do not log it.

When the timeout passes without a result, the job ends as expired, your cancel request is sent, and the agent tells the visitor it could not be done. When the agent cannot write (a person is answering from the inbox, quiet hours, or the WhatsApp or Instagram window has closed), the result waits in the conversation and the next turn gives it. On WhatsApp, whatsapp_template sends that template to bring the visitor back, and the agent gives the result when they answer. When the model fails or never answers on the turn that gives the result, Vatio tries that turn again a minute later, up to three times, unless part of it already reached the visitor. A replay never waits for a callback: the agent is told the job started, as the replayed turn was, and a test of the reply that gave a result replays that turn, with the result as it arrived.

#Follow-ups

A tool whose answer means "this person will need to hear about it later" can say when, and Vatio keeps the time: no reminder job in your backend, and nothing for the model to remember. Set "follow_ups": true:

{
"workspace": "acme",
"name": "create_task",
"description": "Create a task in a project and assign it to someone on the team.",
"when_to_use": "Someone on the team asks to create or assign a task.",
"parameters": {
"type": "object",
"properties": {
"project_id": { "type": "integer" },
"title": { "type": "string" },
"assignee": { "type": "string", "description": "The team member's name" },
"due_on": { "type": "string", "description": "YYYY-MM-DD" }
},
"required": ["project_id", "title", "assignee"]
},
"access": "supervisor",
"follow_ups": true,
"request": {
"method": "POST",
"base_url": "$env.STUDIO_API",
"path": "/tasks",
"headers": { "Authorization": "Bearer $env.STUDIO_API_KEY" },
"body": {
"project_id": null,
"title": null,
"assignee": null,
"due_on": null
}
}
}

and have the answer list follow_ups, at its top level or in data:

{
"result": "ok",
"message": "Task 12 created and assigned to Juan.",
"follow_ups": [
{ "event": "Task 12 was assigned to you by Pedro, due on 2026-11-25.", "to": "+56987654321",
"key": "task-12-assigned" },
{ "event": "Task 12 is due on 2026-11-25. Look it up by its id.", "at": "2026-11-23T09:00:00-03:00",
"to": "+56987654321", "key": "task-12-reminder" }
]
}

Each entry is an event, with the same fields: event, at (without it, within a minute), to (without it, the person in this conversation), key, template and external_ref. When it falls due the agent reads it, looks the task up with its tools, and writes to that person, or writes nothing because the task was closed. A deadline that moves is the same key with the new at in the answer that moves it. The agent is told which reminders are set, so it does not promise its own; one that could not be set (no phone number, a date too far) is named in the result. A replay schedules none. Follow them with GET /events.

For a promise the agent makes itself ("I'll check tomorrow whether it shipped"), list follow_up in the agent's tools: it sets the reminder, for the person in the conversation, with a note of what to check.

#Approval

A tool that should not run on the agent's word alone (a refund, moving a project to the next stage, a discount) can wait for someone on the team to say yes:

{
"workspace": "acme",
"name": "move_project",
"description": "Move a project to another stage.",
"parameters": {
"type": "object",
"properties": {
"project_id": { "type": "integer" },
"stage": { "type": "string", "description": "Diseño, Permisos, Obra or Entregado" }
},
"required": ["project_id", "stage"]
},
"access": "supervisor",
"approval": {
"by": "owner",
"ask": "Move project $params.project_id to $params.stage?",
"timeout": "4h"
},
"request": {
"method": "POST",
"base_url": "$env.STUDIO_API",
"path": "/projects/$params.project_id/stage",
"body": { "stage": null }
}
}

When the agent calls it, nothing is sent to your backend. The people on the team who hold the by role or a higher one (supervisor, the team, if omitted; developer or owner), with a verified WhatsApp number, are asked on WhatsApp, each in their own chat with the agent, in the words of ask (its $params filled in; the tool's name and arguments without it). The agent tells the person who asked that it is waiting for approval.

  • Yes: the request goes to your backend at once, with the arguments it was asked with, and its answer reaches the conversation that asked, as an async tool's result does.
  • No: the conversation that asked is told it was turned down, with the note the approver gave.
  • Nobody answers within timeout (5m to 8h, 8h if omitted): it lapses, and the agent says it was not done.

Someone on the team who may approve it themselves is not asked: for them the tool runs when they call it. Outside an approver's 24-hour window the request opens with the template set for questions to the team, with who asked and what as its two parameters. A tool cannot both wait for approval and be async. A replay asks nobody: the agent is told the team was asked.

#Tool results

Every tool returns an object with result (ok or error) and a non-empty message. Additional fields, such as data and error_key, are allowed.

{ "result": "ok", "message": "This product is out of stock.", "data": { "stock": 0 } }
{ "result": "error", "message": "Stock could not be checked.", "error_key": "backend_unavailable" }

Use ok when the operation completed, including an empty result or negative answer. Use error when it could not complete. Invalid results become a platform error. Tool results are visible to the model; never return credentials.

One reply can make up to 12 tool calls. After the twelfth, or after the same tool fails three times with the same message, the agent is told to stop and answer with what it has, saying what it could not do, and any further call in that reply is refused. So make an error's message say what to change: "account cannot be changed; delete the transaction and create it again" lets the agent recover on its next call, where "Nothing to change" only gets it retrying.

A 409 when Saturday filled up a second ago lets the agent answer honestly ("Monday at 10:00 is free"). A failure hidden inside a 200 becomes a confident confirmation of a booking that does not exist. An empty search is still ok: it worked, and the answer was no.

#Test a tool

set_tool checks the tool's fields and saves it; a mistake is refused with what to fix, and nothing changes. Your team has it at once and everyone once the tests that pass today pass on it (Deployments). Exercise the tool through conversations with chat_with_agent, which talks to the newest version. There is no tool that calls a tool directly.

{ "workspace": "acme", "message": "Do you have the Trail 29 in a medium frame?" }

Leave chat_id out to start a new conversation, and pass the chat_id the reply returned to continue it.

Each reply comes back with every call, its arguments and what your backend answered, and get_conversation shows a whole conversation the same way. chat_with_agent speaks as a tester unless told who is writing: as_phone me (or a customer phone) for tools that need $contact.phone_number or a team role. For private tools the visitor has to be signed in.

  • Tools cannot reach localhost. Expose your local backend through a tunnel and set its URL as the secret's test value, which leaves your customers' conversations on the value everywhere: set_secret with "tests": true. Every test run calls it too, so a test whose tool cannot reach the tunnel fails.
  • Test replays call your tools. Point them at a sandbox with a test value (set_secret with "tests": true). A write whose URL has no test value is simulated instead of sent, so a replay never books a real service. A call the reported turn made that names the visitor ($contact.*, $auth.*) gets the answer your backend gave then; any other call talks as your verified WhatsApp, so $contact.phone_number is your number.
  • Checks live in code. Whether a booking belongs to the person asking is decided by your backend, never by the instructions.

#How your backend is answering

Every call a declarative tool makes is measured where it leaves Vatio: the HTTP status, how long your backend took, and how it ended — ok, an HTTP error, a timeout (the tool's timeout, 8 seconds unless it sets one; work that takes longer is an async tool), a connection that failed, or a 2xx that was not JSON. A call the cache answered is recorded too, marked as cached. A failing tool does not always show in the conversation, because the agent apologizes and moves on, so check get_tool_health:

  • each tool's calls, how many the cache answered, error rate, timeouts, and p50/p95 latency over the last hour, day, 7 days or 30 days, in your customers' conversations, including tools never called. The error rate and the latencies are over the calls that reached your backend;
  • the calls that failed, with what your backend answered and the conversation they were in.

The inbox's Tools page (owner and developers) shows the same. get_tool_health takes period: 1h, 1d, 7d (the default) or 30d.

In the inbox, each of the agent's replies shows the calls it made, with their arguments and what came back. What your backend answered is kept encrypted, cut to 4 KB, and deleted after 30 days; the status, duration and outcome stay.

#Built-in tools

ToolPurpose
knowledge_lookupSearch the knowledge bases listed in knowledge
knowledge_writeWrite what the business says on WhatsApp into the knowledge base (supervisor role and up)
ask_teamAsk the team what the agent cannot answer: the supervisors, or the owner and developers while there are none, in For you and on WhatsApp (Ask the team)
answer_customerSend a supervisor's answer to the customer who asked (only supervisors)
supervisor_questionsList the customers' questions still waiting for an answer (only supervisors)
identify_contactSave a name supplied by the visitor
request_contact_infoAsk a WhatsApp visitor to share their phone number
send_imageSend a WhatsApp contact a photo one of your tools returned
instagram_storyPublish a photo the team sent as an Instagram story (supervisor role and up)
team_membersAdd someone to the team by their WhatsApp number, list the team, or take someone off, from your own WhatsApp (supervisor role and up)
rememberSave a lasting fact about the contact for later conversations
recallSearch summaries of earlier conversations with the contact
follow_upSet itself a reminder to come back to this person on WhatsApp at a set time; see Follow-ups

Enable knowledge_lookup, identify_contact and request_contact_info by listing them in the agent's tools (update_agent), next to your own tools. To have the agent ask for a person, give it a tool of your own: see Human in the loop. request_contact_info sends a message with a sharing button, and that message ends the agent's turn; the number arrives only if the visitor shares it in a later message, and the dependent operation can be retried then. A tool that requires contact.phone_number sends the same request on its own (see Required values), and the two never send it twice in a row.

#Photos

send_image sends the contact a photo on WhatsApp, with a caption under it: a product from your catalog, a place, a document your backend keeps. Enable it in the agent's tools, and have the tool that lists those things return an image URL for each one (keep it in respond.data if you map the response).

  • Only a URL one of your tools returned in this conversation, exactly as it came back. One the agent wrote, or a visitor typed, is refused with invalid_argument, so nobody can talk the agent into sending a picture of their choosing from your number.
  • Fetched when the agent calls the tool: an https URL serving a JPEG or PNG up to 5 MB, from a public address, like a tool request. A URL that does not serve one fails the call with image_unavailable, and the agent says so in words.
  • Sent right after the reply, one photo per call and up to 10 a turn, in the order the agent called it. The reply is the text that comes before them. Each photo and its caption show in the inbox like any reply. Links are stripped from captions.
  • WhatsApp only. On any other channel the tool answers unsupported_channel and the agent describes the picture instead. An eval replay fetches and sends nothing.

#Memory

Once a conversation with a known contact has been quiet for 30 minutes, Vatio summarizes it in two or three lines and saves any lasting facts it revealed as notes, for every agent. Supervisors read both in the inbox, on the contact.

Enable remember, recall or both, the same way, to give the agent that memory too. With either one on:

  • Up to 20 notes about the contact are in the agent's prompt on every conversation, so it knows them without calling anything.
  • remember saves a note the moment the visitor says something worth keeping.
  • recall searches the summaries and notes, and returns the few that match -- never a whole transcript.

Memory belongs to the contact, so every agent in the workspace that has it on shares it, and what the agent remembers from your team's conversations with it never mixes with what it remembers from your customers'. What the business teaches the agent for everyone is not memory but knowledge, written with knowledge_write. If your workspace already defines a tool named remember or recall, yours keeps the name and the platform tool is not attached.

A tool that reads a signed-in visitor's own records needs access: private and your app's public key, given with set_auth (Authentication).

#Frequently asked questions

#How do I connect an AI agent to my own API?

Each endpoint becomes a tool: one HTTP request set with set_tool, the parameters the agent fills, and placeholders for your secrets. Connect the Vatio MCP (https://vatio.ai/mcp) to your coding agent, run npx @vatio-ai/skills in your app's project and then /vatio in Claude Code: it reads your app's routes, adds one tool per endpoint with set_tool, and tries them with chat_with_agent. See Build an AI agent.

#Where does multi-step logic go if a tool is one request?

In your backend. Branching, a second call or a computed answer is code: put it behind one endpoint that does the whole job and give the agent that endpoint as a tool. Three chained tools leave the logic in a prompt.

#Can the agent call an API running on localhost?

No. Tools run on Vatio's servers. Expose your local backend through a tunnel and set that URL as the secret's test value, which your team's conversations with the agent and every test run use: set_secret with "tests": true.

#What should my API return when something goes wrong?

A real HTTP status and a message that says what to change. A 2xx is ok, anything else is error. See Response mapping.

#What if my API takes longer than 8 seconds?

Give the tool a timeout of up to 30 seconds. A GET whose answer is the same for everyone can also be cached with cache, so only the first call waits. Work that takes longer than 30 seconds is an async tool. See Timeout.

Last updated:

Latest release: 0.144.0 · Changelog · The whole contract as Markdown: /docs/docs.md