Function Calling / Custom Tools

Function calling lets your bot perform actions beyond answering questions — check order status, look up inventory, create tickets, or call any API endpoint. Define your tools once, and the AI decides when to use them based on the conversation.

How It Works

  1. 1
    Define a tool with a name, description, HTTP endpoint, and parameters. The description tells the AI when the tool is relevant.
  2. 2
    The AI decides when to call the tool based on the user's question and the tool's description. No manual triggers needed.
  3. 3
    Voquii makes the HTTP request to your endpoint with the parameters extracted from the conversation.
  4. 4
    The response is incorporated into the bot's answer. The AI uses the data returned by your API to craft a natural-language reply.

Creating a Tool

Go to Dashboard → Bot Settings → Tools to create and manage your custom tools.

Tool Configuration Fields

FieldDescription
NameFunction-style identifier (e.g., check_order_status, get_inventory)
DescriptionTells the AI when to use this tool (e.g., "Check the status of a customer order by order number")
Endpoint URLYour API endpoint that handles the action
HTTP MethodGET, POST, PUT, or DELETE
ParametersJSON Schema defining the expected input
Custom HeadersAuthorization headers (Bearer tokens, API keys)
TimeoutHow long to wait for a response (1–30 seconds)

Example Tools

Order Lookup

Name:        check_order
Description: Check the status of a customer order by order number
Endpoint:    https://api.yourstore.com/orders/{id}
Method:      GET
Parameters:  { "id": { "type": "string", "description": "The order ID" } }
Headers:     { "Authorization": "Bearer sk_live_..." }

Appointment Availability

Name:        check_availability
Description: Check available appointment slots for a given date
Endpoint:    https://api.yourbiz.com/slots
Method:      POST
Parameters:  {
  "date": { "type": "string", "description": "Date in YYYY-MM-DD format" },
  "service": { "type": "string", "description": "Type of service requested" }
}

Support Ticket

Name:        create_ticket
Description: Create a support ticket when the customer has an issue that needs follow-up
Endpoint:    https://api.helpdesk.com/tickets
Method:      POST
Parameters:  {
  "subject": { "type": "string", "description": "Brief summary of the issue" },
  "description": { "type": "string", "description": "Detailed description" },
  "priority": { "type": "string", "enum": ["low", "medium", "high"] }
}

Tool Execution

How parameters are sent depends on the HTTP method:

MethodParameter Handling
GET / DELETEParameters become URL query params
POST / PUTParameters become JSON request body
Response parsing: Responses are parsed as JSON when possible, otherwise treated as plain text. The AI uses the returned data to formulate its reply.
Error handling: Timeouts and errors are handled gracefully. If a tool call fails, the bot explains to the customer that it couldn't complete the action and suggests alternatives.

Enable / Disable

Each tool has an active toggle. Disabled tools are not offered to the AI and will never be called. This lets you temporarily turn off a tool without deleting its configuration — useful for maintenance windows or when debugging your API endpoint.

Tips

1

Write clear descriptions

The AI uses the description to decide when to call the tool. Be specific about what the tool does and when it should be used. A vague description leads to incorrect tool usage.

2

Keep parameter schemas simple

Stick to flat objects with clear field names and descriptions. Deeply nested schemas are harder for the AI to populate correctly.

3

Return clear, concise responses

Your endpoint should return data that the AI can easily relay to users. Avoid returning raw database rows or internal error codes. Structure your response with user-friendly fields.

4

Set appropriate timeouts

The default timeout works for most fast APIs. If your endpoint takes longer than 5 seconds (e.g., querying external systems), increase the timeout value accordingly. The maximum is 30 seconds.

Example: Full Conversation Flow

How tool calling works in a real conversation
Customer: "Where is my order #ORD-4821?"

   [AI recognizes this matches the check_order tool]
   [Voquii calls: GET https://api.yourstore.com/orders/ORD-4821]
   [Your API returns: { "status": "shipped", "tracking": "1Z999AA10123456784",
                         "carrier": "UPS", "eta": "2026-02-15" }]

Bot: "Your order #ORD-4821 has been shipped via UPS! Your tracking
      number is 1Z999AA10123456784 and the estimated delivery date
      is February 15th. Is there anything else I can help with?"

Next Steps