Tool Call with Wrong Variable
# support
l
I have a call where the agent collected an email, the caller corrected it, the agent verbally confirmed the corrected version, but the booking tool then fired with the original incorrect email instead of the corrected one. How does Vapi handle variable/slot updates when a caller corrects a previously-stated value? Does the captured value get overwritten, or does the first capture stick? And is there a way to prevent capturing the wrong value?
r
Vapi doesn’t automatically lock a value just because it was first captured. In general, the last successfully updated slot/variable is what should be used but if the agent/tool call fires before the correction is fully committed, the original value can still be passed through. This usually happens when the booking tool is triggered off the earlier turn instead of the final confirmed state. Best way to prevent it is to explicitly force an update/overwrite step after confirmation (or only trigger the booking tool after a “final confirmed email” variable is set), so the tool always reads the latest validated value instead of the initial capture. I can help you restructure the prompt/tool flow so corrections reliably override previous inputs. @lotalop
c
Hey, The first capture does NOT inherently stick, and the value can be overwritten. If the LLM understands that the user corrected themselves, it will extract the updated value based on the most recent context. You can structure your prompt something like this Step 1: Ask for the caller's email address. Step 2: Read back the email address letter-by-letter to confirm accuracy. Step 3: If the caller corrects the email, repeat the entire updated email back again for confirmation. Step 4: DO NOT call the \[Your Booking Tool] until the user has explicitly confirmed that the final email address is 100% correct.
l
thank you!