Skip to main content
Tool calls let your AI assistant connect to your backend systems to retrieve real-time data and trigger actions. They’re the core mechanism behind integrations with your database, PMS/CRM, and operational services. A tool is a single, specific capability your assistant can use such as looking something up or completing a task.

Common tool call examples

Fetch information

  • Get order status using an order number
  • Retrieve a door lock code using a reservation number
  • Check room availability using check-in and check-out dates

Perform an action

  • Create a new apointment in your
  • Save a guest’s arrival time to your PMS/CRM
  • Create a new appointment in your CRM (HubSpot, Salesforce)
1

Create the tool definition

Use POST /tools to register the tool your assistant can call.
{
  "name": "get_order_status",
  "description": "Returns the status for a given order number.",
  "parameters": {
    "type": "object",
    "properties": {
      "order_number": { "type": "string", "description": "Order number." }
    },
    "required": ["order_number"]
  },
  "endpoint": {
    "url": "https://api.client.com/tools/get-order-status",
    "method": "POST",
    "timeoutMs": 10000
  }
}
Once created, the assistant can call this tool whenever it needs an order status.References
2

Implement your backend endpoint

Implement the endpoint you provided in endpoint. Visito will send a JSON body that matches your parameters schema.
Your endpoint response must include a single string (for example, data).
If you return an object or array, Visito will automatically apply JSON.stringify(...) before infjecting your response into the assistant context.
// Example Express handler
app.post("/tools/get-order-status", async (req, res) => {
  const { arguments, meta } = req.body;

  console.log(meta) // { conversation, contact }

  const { order_number } = arguments
  const order = await findOrderByOrderNumber(order_number);

  if (!order) {
    return res.json({ data: "No order found." });
  }

  // Keep it short and directly useful to the assistant.
  return res.json({ data: `Status: ${order.status}` });
});
Tip: Keep the string short and focused on what the assistant needs next.
3

Test it in our Playground

Once your tool is created, open the Visito AI Playground and try it end-to-end.For example, ask:
“What is my order status?”
You should see the assistant:
  1. Ask you for the order number (the required input), and then
  2. Execute the Tool Call and use the returned status in its reply.
Conversational Api Tool Call Pn
Tip: You can refine how and when the assistant should execute a Tool Call by adding instructions in your System Prompt.
You can also add guidance directly in the tool’s description (for example: when to call it, what to ask first, and what to do if the tool returns no result).
There is a sample server available in our github page