Overview
Tools let your AI agent do more than just answer questions. By registering tools, you give the agent the ability to perform actions on your website — add items to a cart, navigate to a page, look up account details, or anything else you can do with JavaScript. When a visitor asks something that requires an action, the agent automatically picks the right tool, passes the correct parameters, and returns the result in the conversation.Register a tool
Use theregisterTool method on your Zephlo instance:
Tool definition
Each tool has four fields:Writing good descriptions
Thedescription field is what the agent sees when deciding which tool to use. Be specific about when and why the tool should be called:
Input schema
TheinputSchema follows JSON Schema format. Here are the supported types:
Example schema with all features
The execute function
Theexecute function runs in the browser when the agent calls the tool. It has full access to the DOM, localStorage, fetch, and any other browser API.
Rules:
- Must return a
string(orPromise<string>) - Can be synchronous or asynchronous
- The returned string is sent back to the agent as the tool’s result
Examples
Navigate to a page
Search products
Toggle dark mode
Get page context
Listening for tool results
You can listen for tool results to update your UI or trigger side effects:Listing registered tools
Retrieve all registered tools and their schemas:WebMCP browser integration
Zephlo implements the emerging WebMCP browser standard. When you register a tool, it’s also published tonavigator.modelContext if the browser (or an agentic extension) supports it. Conversely, any tools other scripts have registered on navigator.modelContext are automatically discovered and made available to your agent.
This means your tools can be shared with the visitor’s own AI assistant, and tools provided by other parts of your page work with Zephlo — no extra wiring. The standard API works everywhere regardless of browser support, so you don’t need to feature-detect it.
Next steps
Form tools
Turn HTML forms into tools with zero JavaScript.
Widget integration
Learn about embedding and customization options.