detraxsenpai
10/08/2025, 10:13 AMAI Evy
10/08/2025, 10:13 AMAI Evy
10/08/2025, 10:13 AMend_call, check_availability_cal, book_appointment_cal) through the general_tools parameter when updating your Retell LLM [(2) ]() .
Here's how to add these functions using the SDK:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.update('16b980523634a6dc504898cda492e939', {
begin_message: 'Hey I am a virtual assistant calling from Retell Hospital.',
}) ;
The general_tools array can include predefined tools like end_call [(3) ]() [(2) ]() . For appointment booking tools like book_appointment_cal, you would configure them with your Cal.com credentials :
javascript
[
{
"type": "end_call",
"name": "end_call",
"description": "End the call with user."
}
]
javascript
{
"type": "book_appointment_cal",
"name": "book_appointment",
"description": "Book an annual check up.",
"cal_api_key": "cal_live_xxxxxxxxxxxx",
"event_type_id": 60444,
"timezone": "America/Los_Angeles"
}
The tools can be added either as general_tools (available in all states) or within specific states if you're using a multi-state agent . For appointment booking setup, you'll need to connect your agent to a Cal.com account with the necessary credentials and event ID [(4) ]() .AI Evy
10/08/2025, 10:13 AMAI Evy
10/08/2025, 10:13 AMdetraxsenpai
10/08/2025, 10:16 AMAI Evy
10/08/2025, 10:16 AMAI Evy
10/08/2025, 10:17 AMend_call and book_appointment_cal tools to your Retell LLM using the general_tools parameter [(1) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.update('16b980523634a6dc504898cda492e939', {
general_tools: [
{
"type": "end_call",
"name": "end_call",
"description": "End the call with user."
},
{
"type": "book_appointment_cal",
"name": "book_appointment",
"description": "Book an annual check up.",
"cal_api_key": "cal_live_xxxxxxxxxxxx",
"event_type_id": 60444,
"timezone": "America/Los_Angeles"
}
]
}) ;
console.log(llmResponse.llm_id) ;
This code updates an existing Retell LLM with both tools in the general_tools array . The tools will be available to the LLM regardless of which state the agent is in . Make sure to replace:
- '16b980523634a6dc504898cda492e939' with your actual LLM ID
- 'YOUR_RETELL_API_KEY' with your actual API key
- "cal_live_xxxxxxxxxxxx" with your actual Cal.com API key
- 60444 with your actual Cal.com event type IDAI Evy
10/08/2025, 10:17 AMAI Evy
10/08/2025, 10:17 AMdetraxsenpai
10/08/2025, 10:17 AMAI Evy
10/08/2025, 10:17 AMAI Evy
10/08/2025, 10:17 AMend_call, book_appointment_cal, and check_availability_cal tools to your Retell LLM [(1) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.update('16b980523634a6dc504898cda492e939', {
general_tools: [
{
"type": "end_call",
"name": "end_call",
"description": "End the call with user."
},
{
"type": "book_appointment_cal",
"name": "book_appointment",
"description": "Book an annual check up.",
"cal_api_key": "cal_live_xxxxxxxxxxxx",
"event_type_id": 60444,
"timezone": "America/Los_Angeles"
},
{
"type": "check_availability_cal",
"name": "check_calendar_availability",
"description": "Checks availability for 30-minute consultation calls",
"cal_api_key": "cal_live_xxxxxxxxxxxx",
"event_type_id": 60444,
"timezone": "America/Los_Angeles"
}
]
}) ;
console.log(llmResponse.llm_id) ;
, [(2) ]()
For the check calendar availability function, you'll need the same Cal.com credentials as the booking function [(3) ]() :
- Your Cal.com API key
- Your event type ID from the Cal.com dashboard
- Optional timezone specification
Make sure to replace the placeholder values with your actual credentials and LLM ID .AI Evy
10/08/2025, 10:17 AMAI Evy
10/08/2025, 10:17 AMdetraxsenpai
10/08/2025, 10:26 AMAI Evy
10/08/2025, 10:26 AMAI Evy
10/08/2025, 10:27 AMAI Evy
10/08/2025, 10:27 AMAI Evy
10/08/2025, 10:27 AMdetraxsenpai
10/08/2025, 10:28 AMAI Evy
10/08/2025, 10:28 AMAI Evy
10/08/2025, 10:28 AMAI Evy
10/08/2025, 10:28 AMAI Evy
10/08/2025, 10:28 AMdetraxsenpai
10/08/2025, 11:01 AMAI Evy
10/08/2025, 11:01 AMAI Evy
10/08/2025, 11:01 AMgeneral_tools containing end_call, book_appointment_cal, and check_availability_cal functions follows the standard Retell AI implementation pattern.
If you could share the specific approach you're asking about, I'd be happy to review it against the available documentation and provide feedback on whether it's correct.AI Evy
10/08/2025, 11:01 AMAI Evy
10/08/2025, 11:01 AMdetraxsenpai
10/08/2025, 11:10 AMAI Evy
10/08/2025, 11:10 AMAI Evy
10/08/2025, 11:10 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(llmResponse.llm_id) ;
The response will include the general_tools array showing all currently configured tools . The returned object contains all the LLM configuration including:
- general_tools - the tools available to the LLM
- states - if using multi-state configuration
- general_prompt - the current prompt
- Other configuration details like model_temperature, tool_call_strict_mode, etc.
You can access the general tools specifically by checking llmResponse.general_tools in the response . This will show you exactly which tools like end_call, book_appointment_cal, and check_availability_cal are currently configured for that LLM .AI Evy
10/08/2025, 11:10 AMAI Evy
10/08/2025, 11:10 AMdetraxsenpai
10/15/2025, 12:38 PMAI Evy
10/15/2025, 12:38 PMAI Evy
10/15/2025, 12:39 PMgeneral_tools array when creating or updating your Retell LLM [(1) ]() . Based on the Discord discussion, here's the structure for custom tools [(2) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.update('16b980523634a6dc504898cda492e939', {
general_tools: [
{
"execution_message_description": "The message you will say to user when calling this tool. Make sure it fits into the conversation smoothly. Do not use a question. Use everyday language.",
"speak_after_execution": true,
"name": "send_SMS",
"description": "sends signup link to caller",
"type": "custom",
"speak_during_execution": true,
"url": "<https://your-endpoint.com/api/custom-function%22>
}
]
}) ;
For custom functions, you can configure several HTTP methods including GET, POST, PUT, PATCH, and DELETE [(1) ]() . You can also define parameters using JSON schema format :
json
{
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "The city of the weather"
}
},
"required": [
"city"
]
}AI Evy
10/15/2025, 12:39 PMX-Retell-Signature for verification
- Header: Content-Type: application/json
- Body: Contains name, call object, and args with the function arguments
Make sure your endpoint URL doesn't have a trailing slash, as this can cause issues where Retell sends GET requests instead of POST requests [(3) ]() .AI Evy
10/15/2025, 12:39 PMAI Evy
10/15/2025, 12:39 PMdetraxsenpai
10/15/2025, 12:58 PMAI Evy
10/15/2025, 12:58 PMAI Evy
10/15/2025, 12:58 PMend_call tool to your LLM using the JavaScript SDK by updating the general_tools array [(1) ]() . Here's the complete code snippet:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.update('16b980523634a6dc504898cda492e939', {
start_speaker: 'user',
begin_message: 'Hey I am a virtual assistant calling from Retell Hospital.',
}) ;
console.log(llmResponse.llm_id) ;
To specifically add the end_call tool, you'll need to include it in the general_tools parameter :
javascript
[
{
"type": "end_call",
"name": "end_call",
"description": "End the call with user."
}
]
The complete SDK call with the end_call tool would look like this:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.update('YOUR_LLM_ID', {
general_tools: [
{
"type": "end_call",
"name": "end_call",
"description": "End the call with user."
}
]
}) ;
console.log(llmResponse.llm_id) ;
Make sure to replace 'YOUR_RETELL_API_KEY' with your actual API key and 'YOUR_LLM_ID' with your actual LLM ID . The end_call tool will be available to the LLM in all states when added to general_tools .AI Evy
10/15/2025, 12:58 PMAI Evy
10/15/2025, 12:58 PM