https://retellai.com/?utm_source=discord&utm_medium=seo logo
the bot keeps reading out the results of tool call...
# ❓・ai-evy-support
j
@AI Evy the bot keeps reading out the results of tool calls verbatim. We're on 5.2
a
Thanks for tagging me @jakeslaps. I'll look through relevant sources and get back to you shortly.
### Answer To prevent the agent from reading tool call results verbatim, you can disable the "Speak After Execution" setting in your Code Tool configuration [(1) ]() . When "Speak After Execution" is enabled (which is the default) , the LLM speaks about the result after execution . To run the tool silently without the agent verbalizing the result, turn this setting off . The code result is capped at 15,000 characters to prevent overloading the LLM context , but if you want the agent to process the result without speaking it out loud, disabling "Speak After Execution" should resolve your issue.
​ To learn more, see the sources I considered: [[1] Code tool for single and multi-prompt agents](https://docs.retellai.com/build/single-multi-prompt/code-tool) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Appreciate the feedback! Feel free to ask me again with additional guidance or context.
j
I want it to respond, I just don't want it to read out JSON
@AI Evy I want it to respond, I just don't want it to read out JSON
a
Thanks for the follow-up, @jakeslaps. I'll get back to you soon.
### Answer I understand—you want the agent to respond naturally about the result, not read the raw JSON verbatim. To control how your agent speaks about tool results, use Response Variables to extract specific values from your code's return and store them as dynamic variables [(1) ]() . Then reference those clean variables in your prompt instead of having the LLM process the raw JSON output . Here's how: 1. In your Code Tool configuration, use Store Fields as Variables to extract values from your return object 2. Specify a variable name and JSON path for each field you want to extract For example, if your code returns
{ "shipping_cost": "$6.00", "zone": "domestic" }
, you can extract: - Variable Name:
shipping_cost
→ JSON Path:
shipping_cost
→ Extracted Value:
"$6.00"
- Variable Name:
shipping_zone
→ JSON Path:
zone
→ Extracted Value:
"domestic"
Then in your agent prompt, instruct it to reference these extracted variables naturally (e.g., "The shipping cost is {{shipping_cost}} for {{shipping_zone}} delivery") rather than processing the raw JSON structure . The code result is capped at 15,000 characters, but by extracting specific fields as variables, you give the LLM clean data to work with instead of raw JSON .
​ To learn more, see the sources I considered: [[1] Code tool for single and multi-prompt agents](https://docs.retellai.com/build/single-multi-prompt/code-tool) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.