https://retellai.com/?utm_source=discord&utm_medium=seo logo
is there a way within a node or in general to allo...
# ❓・ai-evy-support
p
@AI Evy is there a way within a node or in general to allow the retell agent to call one specific tool whenever it wants?
a
Thanks for tagging me @punk8357. I'll look through relevant sources and get back to you shortly.
### Answer Yes, there are two main approaches depending on your agent architecture: For Conversation Flow Agents: Use a Subagent Node to attach tools that the LLM can call during conversation based on context [(1) ]() . When a subagent node has tools attached, the LLM receives both the node instruction and the list of available tools, and determines when a tool should be called based on context . Multiple tools can be added to a single subagent node . To make the agent call a specific tool reliably, you need to write explicit instructions in your node prompt [(2) ]() . Define clear triggers for tool usage by referencing tools by their exact names . For example, specify exact conditions like "If customer mentions 'refund' or 'money back': → Call function
transfer_to_support
immediately" . Best practices for reliable tool calling: - Use trigger words: List specific words/phrases that should trigger tool calls - Define sequences: Specify when tools should be called in order - Set boundaries: Clarify when NOT to call certain tools - Provide context: Explain why each tool is being called Alternative: Function Node If you need guaranteed execution every time the flow reaches a specific point (rather than context-dependent calling) , use a Function Node instead [(1) ]() . Function nodes execute deterministically on node entry, while subagent nodes are LLM-driven and call tools when the LLM decides it's appropriate .
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] Subagent Node](https://docs.retellai.com/build/conversation-flow/subagent-node) [[2] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) ​
p
@AI Evy can the subagent node be just for within that conversation node? so it cant call it the entire conversation?
a
Thanks for the follow-up, @punk8357. I'll get back to you soon.
### Answer Yes, tools attached to a subagent node are only available within that specific node [(1) ]() . Tool execution happens within the subagent node, so the node can stay active across multiple turns and tool calls before it transitions . Once the conversation transitions to another node, those tools are no longer available to the agent. This is different from a global node, which can be accessed from anywhere in the conversation flow . If you want a tool available throughout the entire conversation, you would need to either: 1. Use a global node with the tool attached 2. Add the same tool to multiple subagent nodes where you need it 3. Use Components to reuse the same tool configuration across different parts of your flow [(2) ]() The key point is that tools are scoped to the node they're attached to - they're not globally available unless you specifically configure them that way.
​ To learn more, see the sources I considered: [[1] Subagent Node](https://docs.retellai.com/build/conversation-flow/subagent-node) [[2] Components](https://docs.retellai.com/build/conversation-flow/components) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy how can I dynamically update the number a transfer node calls in my agent?
a
Thanks for the follow-up, @punk8357. I'll get back to you soon.
### Answer You can dynamically update the transfer number using dynamic variables [(1) ]() [(2) ]() . Set the transfer number to a dynamic variable placeholder like
{{transfer_number}}
instead of a static number [(2) ]() . The variable gets substituted at runtime with the actual value you provide [(1) ]() [(2) ]() . How it works: 1. In your transfer call tool or transfer node configuration, set the transfer number field to a dynamic variable (e.g.,
{{transfer_number}}
or
{{department_phone}}
) [(2) ]() 2. Provide the actual phone number value through one of these methods: - **For outbound calls**: Include the variable in your API request when creating the call [(1) ]() - **For inbound calls**: Return the variable in your inbound call webhook response - **Agent-level defaults**: Set default values in the agent configuration as a fallback The transfer number must be in E.164 format or a SIP URI in the format
sip:username@domain
[(2) ]() . Example use case: You could use
{{assigned_agent_number}}
as your transfer number variable, then populate it based on the caller's department, time of day, or any other logic in your webhook - allowing each call to transfer to a different number dynamically [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy can I change the static destination field ?
a
Thanks for the follow-up, @punk8357. I'll get back to you soon.
### Answer Yes, you can change the static destination field by using dynamic variables instead of hardcoding a phone number [(1) ]() [(2) ]() . For transfer nodes (both Call Transfer Node and Transfer Call Tool) , you can set the transfer number to: - A dynamic variable that gets substituted at runtime (e.g.,
{{transfer_number}}
or
{{department_phone}}
) [(1) ]() [(3) ]() [(2) ]() - A number in E.164 format [(3) ]() [(2) ]() - A SIP URI in the format
sip:username@domain
How to implement: 1. In the transfer destination field, enter a dynamic variable placeholder like
{{transfer_number}}
instead of a static number [(1) ]() [(3) ]() [(2) ]() 2. Provide the actual value at runtime through: - **Outbound calls**: Set the variable in the
retell_llm_dynamic_variables
field when using the Create Phone Call API [(1) ]() - **Inbound calls**: Supply the variable in your Inbound Call Webhook response - **Agent-level defaults**: Configure default values in the agent settings as a fallback This allows you to dynamically route calls to different numbers based on your logic - whether that's department, time of day, caller information, or any other criteria you define [(1) ](
om/build/dynamic-variables) [(3) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Call Transfer Node](https://docs.retellai.com/build/conversation-flow/call-transfer-node) [[3] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.