https://retellai.com/?utm_source=discord&utm_medium=seo logo
Can you tell me how can I prevent a tool to run or...
# ❓・ai-evy-support
n
@AI Evy Can you tell me how can I prevent a tool to run or being mentioned in specific hours? Like I have a boolean variable which we can use but how should we use it?
a
Thanks for tagging me @neerajjoshi_. I'll look through relevant sources and get back to you shortly.
### Answer To prevent a tool from running or being mentioned during specific hours, you can use dynamic variables with transition conditions or prompt-based logic. Here's how: Using Dynamic Variables with Transition Conditions: You can set up a boolean dynamic variable (like
is_business_hours
) and use it in transition conditions or prompts to control tool execution. [(1) ]() However, note that Retell AI supports dynamic variables as strings, not as booleans. [(2) ]() Best Approach: 1. Set a string variable (e.g.,
business_hours_active
) to
"true"
or
"false"
based on the current time 2. Use equation-based transition conditions to check the variable before allowing the flow to reach nodes that call the tool [(3) ]() 3. In prompts, reference the variable to guide the LLM's behavior Example in Conversation Flow: - Use a Logic Split or transition with an equation condition like
{{business_hours_active}} == "true"
before the tool-calling node - If false, route to an alternative path that skips the tool Setting Time-Based Variables: You can leverage system variables like
{{current_hour}}
or
{{current_time}}
to calculate whether you're in business hours, then store the result in a custom dynamic variable. [(1) ]() In Prompts: Include instructions like: "If
{{business_hours_active}}
equals 'false', do not mention or use the booking tool." [(3) ]() The key is treating your boolean as a string value and using equation conditions in your conversation flow transitions to control which nodes (and therefore which tools)
are accessible. [(4) ]() [(3) ]() [(2) ]()
​ To learn more, see the sources I considered: [[1] Dynamic variables: personalize Retell agent calls](https://docs.retellai.com/build/dynamic-variables) [[2] Boolean dynamic variable issue](https://discord.com/channels/1186424376300679209/1381979752394522696) [[3] How to set up the flow to avoid repeating what was mentioned already](https://discord.com/channels/1186424376300679209/1390655241170456617) [[4] Nodes and edges](https://docs.retellai.com/build/conversation-flow/node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy what about a global node how can we stop that node to get activated?
a
Thanks for the follow-up, @neerajjoshi_. I'll get back to you soon.
### Answer To control when a global node activates, you can use equation-based transition conditions with dynamic variables. [(1) ]() How to prevent a global node from activating: Global nodes are evaluated alongside regular prompt conditions during transition checks. You can use equation conditions to prevent activation based on your boolean variable (stored as a string) : 1. Add an equation condition to the global node's entry condition 2. Use your time-based variable (e.g.,
{{business_hours_active}}
) 3. Set the condition to only allow activation when appropriate Example equation conditions:
Copy code
- {{business_hours_active}} == "true"
- {{current_time}} > 9 AND {{current_time}} < 18
Evaluation order matters: When transition checks run, the evaluation order is: 1. Always edge (if present) 2. Equation conditions - evaluated deterministically before prompt conditions 3. Prompt conditions - evaluated by the LLM alongside global node entry conditions 4. Else edge 5. Stay in current node Since equation conditions are evaluated before prompt conditions, placing an equation condition on your global node will block its activation when the condition is false. Key point: Equation conditions can only reference dynamic variables, so ensure your time-based logic sets a variable like
{{business_hours_active}}
before the global node evaluation occurs.
​ To learn more, see the sources I considered: [[1] Transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy Do you have an ai agent skills which can help us improve our prompts?
a
Thanks for the follow-up, @neerajjoshi_. I'll get back to you soon.
### Answer Retell AI provides several built-in tools to help improve your prompts, though there isn't a dedicated "AI agent skill" specifically for prompt generation. Here's what's available: Debug Feature for Prompt Improvement: When your agent gives a wrong response or takes the wrong path, you can use the Debug feature in the LLM Playground. [(1) ]() Click the Debug button on a specific response to see suggested fixes that usually help, including: - Add finetune examples to teach the wording you want - Split the node into multiple nodes when one node is doing too much - Adjust the LLM temperature to trade variety for consistency Testing Tools for Validation: You can test your prompts using the LLM Playground, where you chat with your agent in text (by hand or with an AI-simulated user) and inspect tool calls and transitions turn by turn. [(2) ]() This helps you iterate and improve prompts before going live. [(3) ]() Prompt Engineering Guidance: Retell AI provides a comprehensive Prompt Engineering Guide with best practices for writing effective prompts, including using sectional prompts, explicit tool calling instructions, and structured approaches. [(4) ]() Community Request: There is a community request for a voice-prompt generator and similar helpful tools so users can easily share prompts and get guidance from professionals. [(5) ]() However, this appears to be a feature request rather than an existing capability. For now, your best approach is to use the Debug feature and testing tools to iteratively improve your prompts based on actual agent performance.
​ To learn more, see the sources I considered: [[1] Debug your agent response](https://docs.retellai.com/test/llm-playground-debug) [[2] Testing overview](https://docs.retellai.com/test/test-overview) [[3] Manually test your agent](https://docs.retellai.com/test/llm-playground) [[4] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) [[5] Prompt generator and support](https://community.retellai.com/t/prompt-generator-and-support/176) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.