{{user_name}} in its confirmation and pass
{{user_email}} to a later custom function that creates the appointment.
If you use a conversation flow agent, see Extract Dynamic Variable node.
When to use it
Use this tool when the agent needs a value again during the same call — to personalize a later response, branch on it, or send it to a function or transfer.
Because the agent chooses when to call the tool, extraction isn’t guaranteed to
run at an exact point. When a value must be captured in a strict order, use a
conversation flow instead.
Create the tool
1
Add an Extract Dynamic Variable tool
In the agent’s Functions section, select + Add, then select
Extract Dynamic Variable.

2
Name the tool
Give the tool a Function Name with 1–64 letters, numbers, underscores,
or dashes. Spaces aren’t allowed, and the name must be unique among the
agent’s tools.Add a short Description summarizing what the tool captures. What actually
steers extraction is the per-variable descriptions (next step) and your agent
prompt, so keep this field brief.
- Function Name:
extract_user_details - Description:
Captures the caller's name and email.

3
Add variables
Select + Add under Variables and fill in the fields for each value
you want to capture:
Select Save, then add more variables as needed.
- Variable Name – the name you’ll reference as
{{variable_name}}. Keep it short and unique within the tool. - Variable Description – what the value is. The agent uses this to decide what to pull from the conversation, so a clear description is the main driver of extraction accuracy.
- Variable Type –
Text,Number,Boolean, orEnum. Optional; defaults toText. - Enum Options – the allowed values, added one per row. Shown only when
the type is
Enum. At least one option is required.

4
Save the tool
Select Save to add the tool to the agent. Each variable appears in the
tool’s Variables list.

5
Tell the agent when to extract
Add an instruction to the agent prompt so the agent calls the tool at the
right moment.
Variable types
Pick the type that matches the value. The type guides how the agent formats what it extracts.
All extracted values are stored as strings, matching how dynamic variables work
everywhere else in Retell. A
Number is stored as "42" and a Boolean as
"true". In a Code Tool, convert them
before use, for example Number(dv.order_count).
Use the extracted values
Once extracted, a value behaves like any other dynamic variable:- Reference it in prompts and tool fields with
{{variable_name}}on later turns. - Read it in a Code Tool as
dv.variable_name. - Pass it to a custom function or an agent transfer.
{{variable_name}} stays in its raw form. See
handling missing variables
for how to write prompts that tolerate an unset value.
Play typing sound
Turn on Play typing sound in the tool to play a subtle typing sound on the agent’s audio track while it extracts. Extraction is usually fast, so most agents leave this off.FAQ
Can I extract several values with one tool?
Can I extract several values with one tool?
Yes. Add as many variables as you need under one tool, and the agent fills
the ones the conversation supports in a single call. Group related values (name
and email, for example) so they’re captured together.
What happens if the caller doesn't give a value?
What happens if the caller doesn't give a value?
The tool only sets variables it can extract. A value the caller never
provides isn’t stored, so
{{variable_name}} stays literal until it’s set.
Design prompts to handle an unset variable, or set a default at the agent
level.Can I overwrite a variable later in the call?
Can I overwrite a variable later in the call?
Yes. If the tool extracts the same variable again, the new value replaces the
old one for the rest of the call.
Is this the same as post-call analysis variables?
Is this the same as post-call analysis variables?
No. This tool captures values during the call so the agent can use them in
later turns. Post-call analysis extracts data
after the call ends for reporting and webhooks, and those values aren’t
available mid-call.
The agent keeps re-calling the extract tool. How do I stop it?
The agent keeps re-calling the extract tool. How do I stop it?
Spell out in your agent prompt when to call the tool (for example, “call
extract_user_details once, right after the caller gives both their name and
email”). Since the agent prompt and variable descriptions drive the timing,
vague instructions lead the agent to call the tool repeatedly.

