Called when the AI agent needs to execute a custom tool/function during the conversation.When It's Called#
1.
Agent has tools defined in llm_config.tools[]
2.
During conversation, LLM decides to call a tool
3.
Flireo sends POST request with tool call details
4.
Your endpoint returns the result
5.
LLM continues conversation with the result
Timeout#
Sync tools: Must respond within 10 seconds
Async tools: Respond immediately with 200 OK (fire-and-forget)
Request Payload#
{
"message": {
"type": "tool-calls",
"timestamp": "2025-12-13T12:00:00.000Z",
"call": {
"id": "5c4d030f-43e3-4e65-899e-8148521e660f",
"type": "inboundPhoneCall",
"status": "in-progress"
},
"phoneNumber": {
"number": "+31850835037",
"name": "Flireo Demo"
},
"customer": {
"number": "+31612345678"
},
"toolCallList": [
{
"id": "tool_abc123def456",
"type": "function",
"function": {
"name": "lookup_contact",
"arguments": {
"query": "Jan de Vries"
}
}
}
]
}
}
Multiple response formats are supported:{
"results": [
{
"toolCallId": "tool_abc123def456",
"result": {
"name": "Jan de Vries",
"email": "jan@example.com",
"phone": "+31612345678"
}
}
]
}
{
"result": {
"name": "Jan de Vries",
"email": "jan@example.com"
}
}
Your data directly (no wrapper):{
"name": "Jan de Vries",
"email": "jan@example.com"
}
{
"error": "Contact niet gevonden"
}
Define tools in your agent's llm_config.tools[]:{
"llm_config": {
"tools": [
{
"name": "lookup_contact",
"description": "Look up contact information by name or phone number",
"url": "https://api.example.com/tools/lookup",
"async": false,
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Name or phone number to search"
}
},
"required": ["query"]
}
}
]
}
}
| Field | Type | Required | Description |
|---|
name | string | Yes | Unique tool name |
description | string | Yes | What the tool does (for LLM) |
url | string | No | Per-tool URL (overrides agent webhook_url) |
async | boolean | No | Fire-and-forget mode (default: false) |
asyncResponse | string | No | Message for async tools |
parameters | object | No | JSON Schema for inputs |
For logging or notification tools where you don't need to return a result:{
"name": "log_event",
"description": "Log an event for analytics",
"async": true,
"asyncResponse": "Event logged successfully.",
"parameters": {
"type": "object",
"properties": {
"event_type": { "type": "string" },
"details": { "type": "string" }
}
}
}
The LLM receives the asyncResponse immediately while your webhook processes in the background.Allow the agent to end the call:Allow the agent to transfer the call:{
"type": "transferCall",
"destinations": [
{
"type": "number",
"number": "+31612345678",
"description": "Sales afdeling",
"message": "Ik verbind u door met sales."
},
{
"type": "number",
"number": "+31687654321",
"description": "Support afdeling",
"message": "Ik verbind u door met support."
}
]
}
Example Implementation (Node.js)#
Modified at 2025-12-29 14:27:43