Fares_McKarem
01/11/2026, 6:23 PMAI Evy
01/11/2026, 6:23 PMAI Evy
01/11/2026, 6:23 PMAI Evy
01/11/2026, 6:24 PM{{barber_event_type_id}} that maps to each barber's Cal.com event type ID. [(1) ]()
In your prompt, include logic like:
If the caller wants [Barber Name], use event type ID [hardcoded ID].
### 2. Create Two Custom Functions
Function 1: check_barber_availability
- HTTP Method: GET or POST to your endpoint [(2) ]() , [(3) ]()
- Pass the {{barber_event_type_id}} as a const value or in query parameters [(2) ]()
- Your endpoint calls Cal.com's API with the correct event type ID and returns available slots [(3) ]()
Function 2: book_barber_appointment
- HTTP Method: POST to your endpoint [(2) ]() , [(3) ]()
- Parameters: selected time slot, customer details [(2) ]()
- Your endpoint calls Cal.com's booking API with the event type ID [(3) ]()
### 3. Use Const Values for Hardcoded Mapping
In your custom function parameters, you can use "const" to hardcode values:AI Evy
01/11/2026, 6:24 PMjson
{
"type": "object",
"properties": {
"event_type_id": {
"type": "number",
"const": "{{barber_event_type_id}}"
}
}
}
[(2) ]() , [(3) ]()
### 4. Prompt Engineering
Include explicit instructions:
When user states which barber they want, determine the barber's event type ID:
- John: 1234567
- Mike: 1234568
- [etc for all 20 barbers]
When user provides a time preference, call `check_barber_availability`.
When user confirms a slot, call `book_barber_appointment`.
[(2) ]()
## Why This Works Like "Solid Steel"
- Single agent handles all 20 barbers [(1) ]()
- Your backend controls all Cal.com API logic — if Cal.com changes, you update one place [(3) ]()
- Const values + dynamic variables ensure the correct event type ID is always passed [(2) ]()
- Response variables can extract booking confirmation data for use later in the conversation , [(3) ]()
## Questions I Need From You
1. Do you want the barber selection to happen via caller input during the call, or will it be pre-determined (passed via dynamic variables at call initiation) ?
2. Do you have a backend server ready to receive the custom function requests and call Cal.com's API?AI Evy
01/11/2026, 6:24 PMFares_McKarem
01/11/2026, 6:25 PMFares_McKarem
01/11/2026, 6:26 PMAI Evy
01/11/2026, 6:26 PMAI Evy
01/11/2026, 6:26 PMWhen the caller specifies which barber they want, identify the corresponding event type ID:
- Barber A: 111111
- Barber B: 222222
- Barber C: 333333
[...repeat for all 20 barbers]
When user provides the barber name, call `check_barber_availability` function.
When user confirms a time slot, call `book_barber_appointment` function.
### 2. Custom Function Parameter Schema
For both functions, use a parameter where the LLM resolves the event_type_id based on the barber name from the conversation: , [(2) ]()
json
{
"type": "object",
"required": ["event_type_id"],
"properties": {
"event_type_id": {
"type": "number",
"description": "The Cal.com event type ID for the selected barber"
}
}
}
[(1) ]() , [(2) ]()
### 3. Your Backend Logic
Your endpoint receives the event_type_id in the args object: [(1) ]() , [(2) ]()
javascript
const content = req.body;
// content.args.event_type_id contains the barber's event type ID
// Call Cal.com API with this IDAI Evy
01/11/2026, 6:26 PMAI Evy
01/11/2026, 6:26 PMAI Evy
01/11/2026, 6:26 PMFares_McKarem
01/12/2026, 1:28 AMFares_McKarem
01/12/2026, 1:28 AMAI Evy
01/12/2026, 1:28 AMAI Evy
01/12/2026, 1:28 AMAI Evy
01/12/2026, 1:28 AMbarber_name, event_type_id, date_preference
[(1) ]()
- **Description**: Brief explanation of what each value should be
- **Variable Type**: Choose from Text, Number, Enum, or Boolean
## Passing Variables to Custom Functions
In your custom function parameters, reference the extracted variable in the description field using the {{variable_name}} format.
[(3) ]()
Example description for a parameter:
Use this as the event type ID: {{event_type_id}}
## Important Note
A similar issue was reported where dynamic variables weren't sending via custom functions. The solution was to include the {{variable_name}} syntax in the parameter description field, not just the parameter name.AI Evy
01/12/2026, 1:28 AM