Create Your First Tool
Once your snippet is installed, define what AI agents can do on your site.
Open the Add Tool dialog
In the dashboard, navigate to your site and click Add Tool.
You'll see three options:
- Browse templates — 42 pre-built tools for common use cases
- ✨ Generate with AI — let AI analyze your site and suggest tools
- Build from scratch — define a tool manually
For your first tool, click Build from scratch.
Fill in the tool details
Tool Name (required)
A camelCase identifier used by AI agents to call the tool. Examples: addToCart, searchProducts, submitContactForm.
The name must be alphanumeric plus underscores only. No spaces or hyphens.
Description (recommended) One sentence describing what this tool does — from the AI agent's perspective. This is what the agent reads when deciding whether to call the tool.
Good: Add a product to the shopping cart by product ID and quantity.
Bad: Cart function
Page path (optional) Restrict this tool to specific pages. Leave blank to show on all pages. See path patterns for syntax.
Define the input schema
The input schema describes what parameters the tool accepts. Use the Form Builder to add parameters visually, or switch to Raw JSON for full control.
For a simple addToCart tool:
| Field | Type | Required | Description |
|---|---|---|---|
productId | string | yes | The product identifier |
quantity | number | no | How many to add (default: 1) |
Add executeJs (optional)
The executeJs field contains JavaScript that runs in the visitor's browser when the tool is called. The args object contains the parameters from the input schema.
// Example: add to cart by clicking a button
const btn = document.querySelector(`[data-product-id="${args.productId}"] .add-to-cart`)
if (!btn) return { success: false, error: 'Product not found on page' }
btn.click()
return { success: true, productId: args.productId }If you leave executeJs empty, the tool is still registered and callable — the agent just receives null as the result.
Save and test
Click Create Tool. The tool appears in your site's tool list.
To test it immediately, hover the tool card and click the flask icon (🧪). See Test a Tool on Your Site for the full testing workflow.