### 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) ](
) .