Run the example
With Node.js installed, save the following asorder-status-tool.mjs:
local-demo-only is a deliberately public sample value for loopback testing. Use a new private secret before exposing the endpoint beyond your machine. The server returns fixed demo data and does not verify customer identity; it is not a production order service.
Check the request and response
In another terminal, run:200 body:
The input schema helps the agent construct arguments; still validate requests in your backend. Don’t require live-conversation metadata for direct tests: Visito’s test endpoint sends
meta.tenantId and meta.source: "developer_test", while conversation calls include channel and conversation identifiers. See the complete request contract.
Make the endpoint reachable
The URL you save must work from Visito’s backend, not just your browser.
For a container-hosted demo you may need to change
127.0.0.1 to 0.0.0.0 and configure port access. Keep development access restricted to your test environment. Do not paste a loopback URL into hosted Visito and expect it to reach your laptop.
Use the resulting URL ending in /visito/order-status in Build → Tool calls. Select POST, Bearer, and your endpoint’s secret. Copy the schema and description from the product walkthrough.
Connecting an existing API instead
A GET tool sends arguments as query parameters, for example?order_number=A-1003. A POST tool sends the wrapper { "arguments": { ... }, "meta": { ... } }. It does not send a flat order object or substitute arguments into URL path templates.
If your provider expects /orders/A-1003, a different request body, or rotating OAuth credentials, keep those details in your adapter endpoint. The adapter validates the request, calls the provider, and returns a small JSON result. Provider authentication stays on your server; the tool’s configured secret authenticates Visito to that adapter.
Test the saved definition
You can keep Active off for the API test. Obtain the tool ID from List tools, then setVISITO_API_KEY in your local shell from secure storage. It must be a Visito API key for the test workspace with tools:execute. Listing tools additionally requires tools:read.
Replace YOUR_TOOL_ID before running:
ok: true and the returned output; a failed execution can still return HTTP 200 from the Visito test API with ok: false and an error. A successful curl exit alone is not enough.
The Visito API key here is different from TOOL_DEMO_SECRET. Never put your Visito API key in the custom tool’s Secret field to authenticate to this demo.
Test the agent’s behavior
In a workspace without live customer channels, enable the definition and use a new Playground chat:- “Where is order A-1003?” should produce a completed activity and a reply grounded in the status.
- “Has my order shipped?” should prompt for an order number.
- “Where is order A-9999?” should produce a completed activity and explain that no order was found.
- “Where is order A-5000?” should produce a failed activity and an honest failure response.