neerajjoshi_
05/02/2026, 7:46 AMAI Evy
05/02/2026, 7:46 AMAI Evy
05/02/2026, 7:46 AM{{current_time}}, {{current_time_[timezone]}}, {{call_type}}, {{direction}}, {{user_number}}, and {{agent_number}} . These system variables are reliably populated by Retell's infrastructure.
Extracted Dynamic Variables - When you use the Extract Dynamic Variables tool, the LLM extracts values from user responses and saves them [(2) ]() . You can extract different types including Text, Number, Enum, or Boolean . Since this extraction relies on the LLM interpreting user input, there is potential for the LLM to misinterpret or incorrectly extract values.
Dynamic Variables from Tool Calls - When you set response variables in MCP tools or custom functions, you extract values from the tool response and save them as dynamic variables [(3) ]() . The accuracy here depends on what your external tool returns.
Handling Missing Variables - When a dynamic variable has no assigned value, it remains in its raw form with the curly braces intact [(1) ]() . For example, if user_name is not provided, the prompt would show "Hello {{user_name}}, how can I help you today?" .
To minimize issues with extracted variables, it's recommended to include explicit instructions in your prompt about when to invoke extraction functions [(2) ]() . For example: "When user states his name and phone number, please extract the information by calling the `extract_user_detaiAI Evy
05/02/2026, 7:46 AMAI Evy
05/02/2026, 7:46 AMAI Evy
05/02/2026, 7:46 AMneerajjoshi_
05/02/2026, 7:52 AMAI Evy
05/02/2026, 7:52 AMAI Evy
05/02/2026, 7:52 AMjson
{
"booking_ids": ["xyz", "abc", "qwe"]
}AI Evy
05/02/2026, 7:52 AMbooking_ids[0] to extract the first booking ID .
Reliability considerations:
The extracted values will be stored as dynamic variables and can be referenced later using {{variable_name}} syntax [(4) ]() . However, there are some important points:
1. All dynamic variable values must be strings . If your tool returns an array or complex object, you'll need to extract individual elements or handle the structure appropriately.
2. Variable extraction depends on correct JSON path mapping [(3) ]() . You need to specify the exact path to each value you want to extract.
3. Missing variables remain in raw form - if a variable isn't set, it will appear as {{variable_name}} with curly braces intact [(4) ]() .
Best practice: Extract each booking ID as a separate dynamic variable (e.g., {{booking_id_1}}, {{booking_id_2}}, {{booking_id_3}}) using the response variables feature, then reference them in subsequent tool calls [(1) ]() [(2) ]() .AI Evy
05/02/2026, 7:52 AMAI Evy
05/02/2026, 7:52 AMneerajjoshi_
05/02/2026, 7:55 AMAI Evy
05/02/2026, 7:55 AMAI Evy
05/02/2026, 7:55 AM{{variable_name}} syntax . Once set (either through the API, webhooks, or extracted during the call) , they remain available for the duration of that call session.
For variables from tool responses:
When you use the "Store Fields as Variables" feature in custom functions or MCP tools, values extracted from API responses are saved as dynamic variables [(2) ]() . These can then be referenced in subsequent tool calls using {{variable_name}}.
Important considerations:
1. All dynamic variable values must be strings [(1) ]() [(3) ]()
2. Variables are call-scoped - they persist for the duration of the call
3. Missing variables remain in raw form - if a variable isn't set, it appears as {{variable_name}} with curly braces [(1) ]()
Potential issue with agent transfers:
There is one documented case where dynamic variables may not persist: during agent transfers. A community discussion indicates that dynamic variables set in one agent may not automatically transfer to the swapped agent [(4) ]() . However, this appears to have been resolved in that specific case.
Bottom line: For normal tool-to-tool calls within the same agent during a single call session, dynamic variablesAI Evy
05/02/2026, 7:55 AMAI Evy
05/02/2026, 7:55 AMAI Evy
05/02/2026, 7:55 AMneerajjoshi_
05/02/2026, 8:51 AMAI Evy
05/02/2026, 8:51 AMAI Evy
05/02/2026, 8:56 AMAI Evy
05/02/2026, 8:56 AMAI Evy
05/02/2026, 8:56 AM