How do I make the AI agent look up data in my system?
On the agent page, open Tools. The Built-in block turns on and off what the agent already knows how to do in the CRM (book meetings, create tasks, fields, tags and proposals), across all of its deployments. For your system's API, click New tool in the Custom tools block. You describe a call to your system API (URL, headers and parameters) and write When to use. During the conversation, the agent reads that description, decides on its own when to call it, fills in the parameters with what the contact said and answers with the data your API returned.
Example: the contact asks "where is my order 4821?", the agent calls check_order with number = 4821 and answers with the status and tracking code.
Permission: creating, editing, testing and deleting tools requires permission to edit AI agents.
Before you start
- An API of your system reachable over the internet on https://. Internal addresses (local network,
localhost) are refused. - If the API requires authentication, have the key or token at hand.
Steps
-
Open Settings > Accounts center > My agents, open the agent and click Tools in the Behavior menu. Click New tool.
-
Under What the agent sees, fill in:
- Tool name: lowercase letters, numbers and
_, starting with a letter (e.g.check_order). - When to use: write it as an instruction. Say when to use it and what to ask the contact first (e.g. "Use when the customer asks about the status or delivery of an order. Ask for the order number if they haven't said it.").
- Tool name: lowercase letters, numbers and
-
Under The call, pick the Method and fill in the URL. Use markers for what changes in each conversation:
{{name}}: a value the agent fills in (e.g.https://api.yourstore.com/orders/{{number}}).{{lead.email}}: contact data. Acceptsid(the contact's Clickmax id),name,email,telephoneor a custom field key.
The URL domain cannot contain a marker.
-
Add the Headers the API requires. For the access key, check Secret: the value is encrypted and never shown again. When editing later, leave the field blank to keep the saved value.
-
If needed, add URL parameters (query) and, for POST, PUT and PATCH, the Request body. In a JSON body, wrap the marker in quotes when the value is text:
"number": "{{number}}". -
Under Parameters the agent fills in, describe each
{{name}}you used. When the page shows Used in the call but not described yet, click Create parameters. For each one, pick the Type (Text, Number or Yes/no), check Required if it is, and write the Description for the agent. For text parameters, Accepted values limits the options. -
In the Test panel, fill in sample values and click Run test. The call is really made and the panel shows the status, the time and the response, already cut to the size the agent reads.
-
Click Save tool. It applies from the next message in the agent conversations, with no need to publish a new version.
In the Tools list, the switch next to each tool turns it on and off without deleting it. Edit reopens the form and the trash icon deletes it.
What happens in conversations
- Read and write: GET tools only read. POST, PUT, PATCH and DELETE show Writes to the system and are left out of deployments in suggestion mode.
- Errors: if your API answers with an error, takes longer than the limit or is down, the agent gets the warning and carries on (for example, asking for the data again or saying it will check). Redirects are not followed: use the final URL. To see what your API answered on each call, open the AI SDR analytics and click the tool name in Tools.
- Test chat: in the agent Test agent chat, GET tools really run; the ones that write to your system are simulated. The test chat has no contact, so
{{lead.*}}is empty.
Limits
The last two are under Limits in the tool form.