https://retellai.com/?utm_source=discord&utm_medium=seo logo
Every time my agent goes to answer a question abou...
# ❓・ai-evy-support
a
@AI Evy Every time my agent goes to answer a question about a course, it gives an answer before it gives the tool call. Then it updates the answer after the tool call has come back but I've specifically instructed it to wait for the tool call to come back before it gives an answer. How do I prevent it from answering before it has the results of the tool call? I have this in my global prompt : - If a user requests details about a specific course, always call the "GetCourseSchedule" tool where the most up to date information is listed, then wait for the results of the tool before providing an answer. https://cdn.discordapp.com/attachments/1302816169367044149/1488186845807251610/image.png?ex=69cbdd81&is=69ca8c01&hm=9089dec817bb969606eb571c85c1e369c7c9824466d999b87b2eb54d1595d392&
a
Thanks for tagging me @Anthony. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, there's a specific configuration setting that controls whether the agent speaks before or after tool execution. In your custom function configuration, ensure you have enabled "Speak After Execution" [(1) ]() . This setting determines whether the agent waits for the tool result before responding to the user. When configuring your GetCourseSchedule tool, look for this option in the tool settings. Without this enabled, the agent will provide a response before the tool executes, which matches the behavior you're experiencing . Additionally, strengthen your prompt instructions by being more explicit about the execution order. Instead of just saying "wait for the results," try structuring your prompt to clearly indicate the agent should NOT provide any course information until after the tool returns data [(2) ]() . For example, you might revise your prompt to: - "When a user asks about course details, you MUST call GetCourseSchedule first and provide NO information until the tool returns results. Do not speculate or provide any course details from memory." The key is combining the "Speak After Execution" setting with explicit prompt instructions that prevent the agent from answering prematurely [(2) ]() [(1) ]() .
​ To learn more, see the sources I considered: [[1] Tool calling - AI agent doesn't reply back. Stops interacting](https://community.retellai.com/t/tool-calling-ai-agent-doesnt-reply-back-stops-interacting/327) [[2] 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.