Tool Design
Tools let your agent interact with your data and APIs, like checking inventory or making bookings. Start with core tools and add custom ones.
Step 1: Use Core Tools
These are pre-built and auto-available. No setup needed—just reference in your prompt.
| Tool Name | Description | When to Use |
|---|---|---|
| getCurrentTime | Returns current time and timezone. | Time-based questions. |
| launchWebsite | Opens a URL in a new tab. | Direct users to external sites. |
| scrapeWebsite | Fetches website content. | Summarize dynamic info from your site. |
| show_component | Renders UI components (e.g., images, forms). | Display catalogs or confirmations. |
Tip: For visuals, use show_component with props like title and media URLs.
Step 2: Define Custom Tools
Custom tools connect to your APIs via JSON descriptors. Use the JSON Editor to create them.
Basic structure:
{
"kind": "http_tool",
"name": "search_products",
"description": "Search for products.",
"parameters": {
"type": "object",
"properties": {
"query": { "type": "string" }
},
"required": ["query"]
},
"http": {
"method": "GET",
"urlTemplate": "https://your-api.com/products?q={{args.query}}"
},
"ui": {
"onSuccess": {
"open": {
"component_name": "catalog_results",
"props": { "items": "{{response.products}}" }
}
}
}
}
Step 3: Connect to Your Data
Ensure your APIs return structured JSON. Test with mock calls.
Step 4: Save and Integrate
Upload via MongoDB Updater. Reference in your prompt (e.g., "Use 'search_products' for queries.").
Tip: For your first tool, focus on one action like searching. Note rate limits for API calls—details later.