Skip to main content
The canonical tool. A caller asks “where’s my order?”, the agent asks for the number, calls your API, and reads back the answer. We’ll build the endpoint, define the tool, attach it, and test it.

1. The endpoint

Your side. Keep it fast — the agent is holding a live conversation.
Return facts, not sentences. Give the agent {"status":"shipped","expectedDate":"2026-09-03"} and it phrases that naturally in whatever language the call is in. Return "Your order shipped on the 3rd" and your English leaks into a Finnish conversation.

2. Define the tool

What each choice is doing:
This is the only thing the model uses to decide whether to call the tool. Notice it names the phrasings a caller actually uses — “where their order is”, “when it will arrive”, “gives an order number” — rather than describing the endpoint.“Gets order data” would technically be accurate and would fire far less reliably.
baseUrlPattern contains {orderId}, so the parameter is declared as a path parameter and substituted into the URL. Use query for filters, header for metadata, body for structured payloads.
A lookup changes nothing, so the runtime may run it eagerly while the agent is still speaking and discard the result if the conversation turns elsewhere. That removes a noticeable pause.Safe here. Never set it on a booking or a payment.
The default is 2.5s. Database lookups behind a cold connection sometimes exceed that, and a timeout mid-call is worse than a slightly longer pause. The ceiling is 40s.
“usually eight digits” is written for the model, and it helps: it lets the agent recognise when a caller has misheard themselves and read back six digits.
Save the returned id.

3. Attach it to your agent

toolIds is an array, and it must not be empty. Tools live at the workspace level, so this same tool can serve every agent you have — fix a bug in it once and they all get the fix.

4. Tell the agent it exists

The tool is attached, but the agent’s prompt should set expectations:

5. Test it

Create a browser call and try it:
Then work through these deliberately:
Validate the parameter server-side anyway. orderId came from speech recognition — treat it exactly as you would a value typed by an anonymous user.

If it does not fire

Almost always the description, not the wiring.
  • Never fires — name the caller phrasings explicitly in description
  • Fires too eagerly — add a precondition: “Only call this once the caller has given an order number.”
  • Wrong parameter — tighten the parameter’s own description
  • Agent goes quiet — your endpoint exceeded timeout; check your own latency first

Add authentication

When your endpoint needs a credential.

Tool reference

Every option in full.