AI agent
Tools over webhooks
A tool is an HTTP endpoint described with a JSON Schema. The model decides when to call it and with which arguments.
Define a tool
| Field | Example |
|---|---|
| Name | lookup_order |
| Description | Look up an order by number and return status and tracking |
| Method / URL | GET https://api.yourstore.com/orders/{{order_number}} |
| Headers | X-Api-Key: … |
| Input schema | { "type": "object", "properties": { "order_number": { "type": "string" } }, "required": ["order_number"] } |
For GET the arguments are sent as query parameters and {{placeholders}} in the URL are substituted. For other methods the arguments are the JSON body.
Failure handling
If a tool returns an error and Hand over when a tool call fails is on, the agent apologises and hands over with the error in the internal note.
Example endpoint
app.get('/orders/:number', (req, res) => {
res.json({ number: req.params.number, status: 'shipped', eta: '2026-09-13', tracking: 'FX88120' });
});