In short
- Uses your own page code.The agent calls the tools you declare in your dashboard and register on the page, with the visitor's own session and cart.
- Asks before it changes anything.Actions that change something show a confirmation card, and only the visitor's click approves.
- Search, then act.The agent can chain steps, like finding a product and then adding it to the cart, in one answer.
- Only on the right pages.Limit each action to paths like /shop/*, so it is offered only where it makes sense.
Visitors often know exactly what they want but not where to click. Site actions let them just say it. Add two bags of the Kenya coffee, show me only vegan options, book me a demo on Tuesday. The agent does it on your page, and the visitor sees the result right away.
How it works
Your developer registers a tool on the page with one call, onetype addTool, and you declare the same tool in your dashboard under Developer › Tools. A tool has a name, a plain-words description of when to use it, the inputs it takes as a small JSON Schema, and a handler: your own JavaScript that does the work, such as calling your cart. When a visitor asks for something that fits, the agent fills in the inputs, OneType checks them against your schema, and your handler runs in the visitor's browser.
- Say what the action does: read, write or destructive.
- Write the confirmation question, with {param} placeholders filled from the inputs.
- Limit it to certain pages, up to 50 paths.
- Set a timeout from 1 to 120 seconds, 15 by default.
- Update or remove a tool at any time with updateTool and removeTool.
Show the agent what is on screen
The agent can only use a product ID it has actually seen. Pass the products on the current page with setContext, add a search tool for large catalogs, or let your tool accept product names and look up the ID in your own code. An ID the model made up does not count: the call does not run, and the agent is told to search first or ask the visitor.
The visitor stays in control
Anything that changes the page or the cart asks first, unless you explicitly set it not to. Destructive actions, like removing an item, always ask. The approval is a click in the chat, which neither the model nor text on a web page can fake. If the visitor declines, your handler never runs.
Chains of steps
The agent can combine tools in one answer. It can search your catalog, then add the right item to the cart, or look up an order on your server with an API action and then open the order page in the browser. It can make up to 20 tool calls in a single answer.
Arguments are checked against your schema before your handler runs, so an invalid call never reaches your code and the agent is told what was wrong. Your handler can return any JSON result, and the agent uses it in its reply. Give amounts with their currency code so the agent never has to guess one.