pickyourknows
10/15/2025, 7:45 PMAI Evy
10/15/2025, 7:45 PMAI Evy
10/15/2025, 7:45 PMend_call function fires correctly, you need to properly configure both the tool and your prompt instructions [(1) ]() .
Here's how to set it up:
1. **Add the End Call Tool**: Click "+ Add" in the tools section and select "End Call" from the dropdown menu .
2. **Configure Termination Conditions**: Define specific conditions under which the call should be terminated . For example: "If the user says 'thank you', 'goodbye', or 'bye', use the end_call tool to terminate the conversation" .
3. **Update Your Prompt**: This is crucial - enhance the agent's understanding by incorporating the end call conditions directly into the prompt . Include specific instructions such as: "If the user says 'thank you', 'goodbye', or 'bye', use the end_call tool to terminate the conversation" .
**Key Point**: By default, the agent won't end the call automatically . You must explicitly configure when and how the call should be terminated using the end call tool .
The LLM determines when a function is needed based on the conversation context [(2) ]() , so your prompt instructions need to be clear and specific about the conditions that should trigger the end call function.
If you're still having issues, make sure your prompt clearly states the exact scenarios where the agent should use the end_call tool, as the agent relies on these instructions to decide when to execute the function.AI Evy
10/15/2025, 7:46 PMAI Evy
10/15/2025, 7:46 PMpickyourknows
10/15/2025, 7:49 PMAI Evy
10/15/2025, 7:49 PMAI Evy
10/15/2025, 7:49 PMAI Evy
10/15/2025, 7:49 PMAI Evy
10/15/2025, 7:49 PMend_call function can be unreliable, and you're not alone in experiencing this issue [(1) ]() [(2) ]() .
Here are specific troubleshooting steps to improve reliability:
1. Define the Function Correctly
For custom LLM integration, ensure your function is properly defined [(3) ]() :
javascript
private PrepareFunctions() : ChatCompletionsFunctionToolDefinition[] {
let functions: ChatCompletionsFunctionToolDefinition[] = [{
type: "function",
function: {
name: "end_call",
2. Structure Your Prompt Instructions
Use numbered structure in your prompts, which helps with reliability [(4) ]() :
When the conversation comes to an end or the user says "bye":
1. Say "have a great rest of your day".
2. Use "end_call" tool to end the call
3. Test with Simulation
Use LLM simulation testing to verify the function triggers correctly [(5) ]() . You can define evaluation metrics like :
2. Confirm that the end_call function was called at the end of the conversation.AI Evy
10/15/2025, 7:49 PMend_call triggering [(1) ]()
- Some users report better success switching to conversation flow instead of single/multi-prompt agents
- The agent won't hang up unless explicitly designed to do so [(2) ]()
If the issue persists, consider using conversation flow with an End Node, which some users report works more reliably than function calling for ending calls [(1) ]() .pickyourknows
10/15/2025, 8:00 PMpickyourknows
10/15/2025, 8:01 PMAI Evy
10/15/2025, 8:01 PMAI Evy
10/15/2025, 8:01 PMAI Evy
10/15/2025, 8:02 PMAI Evy
10/15/2025, 8:02 PMend_call function not working as expected. Based on the available sources, there's a documented problem where calling end_call programmatically ends the call before the final AI message is spoken out [(1) ]() .
The issue affects both streaming responses and single responses with end_call=True, where the AI doesn't get to speak the final response and hangs up instantly instead .
For SMS chats created using the API, the basic setup involves [(2) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.createSMSChat({
from_number: '+12137771234',
to_number: '+14155551234',
}) ;
However, the end_call function behavior in SMS chats appears to have reliability issues that may require support team assistance to resolve [(1) ]() .
For the standard voice call configuration, you would add the End Call tool and configure termination conditions such as "If the user says 'thank you', 'goodbye', or 'bye', use the end_call tool to terminate the conversation" [(3) ]() . But given the specific SMS chat context and the documented issues, this may not work reliably.
I'd recommend reaching out to support with your specific SMS chat implementation details, as this appears to be a known technical issue that may require backend investigation [(1) ]() .pickyourknows
10/15/2025, 8:08 PMpickyourknows
10/15/2025, 8:11 PMAI Evy
10/15/2025, 8:11 PMAI Evy
10/15/2025, 8:11 PMend_call function in SMS chats, though the sources don't cover all the specific technical details you're asking about.
## What the Documentation Shows
**Function Calling Basics**: Function calling works by having the LLM determine when a function is needed based on conversation context, extract required parameters, and execute the function with those parameters [(1) ]() . For the end_call function specifically, you can define it like this [(2) ]() :
javascript
private PrepareFunctions() : ChatCompletionsFunctionToolDefinition[] {
let functions: ChatCompletionsFunctionToolDefinition[] = [{
type: "function",
function: {
name: "end_call",
description: "End the call only when user explicitly requests it.",
parameters: {
type: "object",
properties: {
message: {
type: "string",
description: "The message you will say before ending the call with the customer.",
},
},
required: ["message"],
},
},
}];
return functions;
}AI Evy
10/15/2025, 8:11 PMAI Evy
10/15/2025, 8:11 PMend_call function. One community member reported that "Sometimes, when the call ends, the agent doesn't end it but instead verbally announces the execution of the tool" [(5) ]() . The suggestion was to use clear instructions about when to use the function and when not to [(4) ]() .
## What's Not Covered
The documentation doesn't specifically address:
- SMS-specific end_call behavior vs voice calls
- Same-turn vs separate-turn execution patterns for SMS
- Rule engine precedence between prompts and termination rules
- SMS-specific function attachment requirements
- Backend validation details for failed end_call attempts
## Recommendations
Based on available information, consider:
1. Using Conversation Flow instead of prompt-only agents, as some community members report better reliability
2. Setting up max call duration and max silence duration as fallbacks to avoid overcharging
3. Using clear, structured prompt instructions with numbered steps
For the specific technical details about SMS chat termination patterns, backend logs analysis, and known bugs with ETAs, you'll need to contact support directly as this information isn't available iAI Evy
10/15/2025, 8:11 PMAI Evy
10/15/2025, 8:11 PMpickyourknows
10/15/2025, 8:17 PMAI Evy
10/15/2025, 8:17 PMAI Evy
10/15/2025, 8:17 PMend_call function problem you're experiencing.
However, I can provide these contact options:
**Sales Contact**: Visit [Contact Sales]() for business inquiries.
**GitHub Repository**: Visit [) for technical resources and potentially to file issues.
For immediate technical support regarding the end_call function reliability issues you're experiencing with SMS chats, you may also want to check if there are additional support channels or contact information available on the main Retell AI website that aren't covered in the current sources.
Would you like a general answer based on my knowledge about typical support channels for technical platforms like this?AI Evy
10/15/2025, 8:17 PMAI Evy
10/15/2025, 8:17 PM