https://retellai.com/?utm_source=discord&utm_medium=seo logo
my agent sometimes repeats itself when hanging up ...
# ❓・ai-evy-support
c
@AI Evy my agent sometimes repeats itself when hanging up before calling the end call tool. how to improve this?
a
Thanks for tagging me @carlo_98907. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available documentation, here are several approaches to improve your agent's end call behavior: 1. Structure Your End Call Instructions Clearly Use numbered steps in your prompt to ensure the agent follows the correct sequence [(1) ]() :
Copy code
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
2. Configure the End Call Tool Properly Add the End Call tool and define specific termination conditions [(2) ]() . For example: "If the user says 'thank you', 'goodbye', or 'bye', use the end_call tool to terminate the conversation." 3. Update Your Agent Prompt Include the end call conditions directly in your prompt : "If the user says 'thank you', 'goodbye', or 'bye', use the end_call tool to terminate the conversation." 4. Use WebSocket End Call Control If you're using a custom LLM via WebSocket, you can set
end_call
to
true
in your response to end the call after the content is fully spoken [(3) ]() . This gives you more programmatic control over when the call terminates. 5. Consider Interruption Settings If your agent is being interrupted during the goodbye message (which can cause repetition) , you might need to adjust interruption sensitivity settings [(4) ]() . This is particularly relevant if the agent is connecting to automated systems that might interrupt the farewell message. 6. Set Fallback Protections Configure max call duration and max silence duration settings to ensure calls don't continue indefinitely if the end call tool fails to trigger [(1) ]() . The key is providing clear, structured instructions and ensuring your agent has multiple ways to gracefully end the conversation.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Discord message from @sanava.ai on 2025-03-14](https://discord.com/channels/1186424376300679209/1294891368505937952/1350213549460553779) [[2] End call](https://docs.retellai.com/build/single-multi-prompt/end-call) [[3] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[4] end call tool doesn't work properly](https://discord.com/channels/1186424376300679209/1327345632616255508) ​