https://retellai.com/?utm_source=discord&utm_medium=seo logo
how can i prompt my agent to use end_call default ...
# ❓・ai-evy-support
c
@AI Evy how can i prompt my agent to use end_call default function properly? it says goodbye but it does not invoke the tool.
a
Thanks for tagging me @carlo_98907. I'll look through relevant sources and get back to you shortly.
### Answer To ensure your Retell AI agent both says goodbye and invokes the end_call tool, you need to clearly instruct it to perform both actions in sequence within your prompt. The documentation and community feedback highlight that simply prompting the agent to "say goodbye" is not enough—the agent must also be told to use the end_call tool explicitly [(1) ]() [(2) ]() [(3) ]() . A best practice is to write your instruction like this: 1. Say your goodbye message (e.g., "Have a great rest of your day") . 2. Use the end_call tool to terminate the conversation. Example prompt update: "When the conversation comes to an end or the user says 'bye': 1. Say 'Have a great rest of your day.' 2. Use the end_call tool to end the call." Structuring your instructions in a numbered or stepwise format improves the likelihood that both actions are executed as intended [(1) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] End call](https://docs.retellai.com/build/single-multi-prompt/end-call) [[2] Agent fails to say goodbye before ending the call](https://discord.com/channels/1186424376300679209/1294639127895212083) [[3] Discord message from @mike_56558 on 2025-03-14](https://discord.com/channels/1186424376300679209/1294891368505937952/1350217287109705728) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
should this instructions be in the general prompt or the starting node if i have an outbound agent ? @AI Evy
a
Thanks for the follow-up, @carlo_98907. I'll get back to you soon.
### Answer For Retell AI single/multi-prompt agents, instructions like saying goodbye and invoking the end_call tool should be included in the general prompt if you want them to apply across all conversation states, not just at the very start [(1) ]() , [(2) ]() , [(3) ]() . The general prompt is appended to every system prompt, so placing stepwise instructions for ending calls there ensures the agent follows them whenever the conversation ends, regardless of which state or node it's in [(1) ]() , [(2) ]() , [(3) ]() . If you put these instructions only in the starting node, they will only influence the agent's behavior at the very beginning of the conversation, which is not suitable for handling call termination at any point [(1) ]() , [(2) ]() .
​ To learn more, see the sources I considered: [[1] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[2] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[3] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @carlo_98907. I'll get back to you soon.
c
@AI Evy can you escalate the issue about end_call not being triggered?
a
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer I can help you understand the end_call function implementation based on the documentation, but I cannot escalate issues directly. For technical support, you should: Visit [Contact Sales]() or visit [) . Regarding the end_call function not being triggered, the documentation shows how to properly implement it [(1) ]() . The function should be defined with a clear description and required message parameter:
Copy code
javascript
export interface FunctionCall {
 id: string;
 funcName: string;
 arguments: Record<string, any>;
 result?: string;
}

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;
}
The community has reported similar issues where agents vocalize function calls instead of executing them [(2) ]() . One suggested workaround is adding to your response guidelines: "When calling a tool / function, DO NOT mix the tool name in your response" . For the WebSocket implementation, you need to handle the end_call properly by setting
end_call: true
in your response event [(3) ]() . Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Integrate Function Calling](https://docs.retellai.com/integrate-llm/integrate-function-calling) [[2] issue with end_call](https://discord.com/channels/1186424376300679209/1239737188531306639) [[3] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​