How to store tool call response as a variable in d...
# support
h
@Vapi @Vapi Support Bot I’m working with a tool call named
checkAvailability
that successfully returns available slots as an array of objects. What I’d like to do is store this tool response in a variable within the dashboard, so that I can later reference it in my flow using
{{availableSlots}}
. Could you please guide me on: - How to capture the tool’s response and assign it to a variable in the dashboard?
v
To capture your tool's response and store it as a variable in the dashboard, use the Extract Variables feature in your workflow after the
checkAvailability
tool node. Configure the extraction prompt to assign the tool's output to a variable, for example:
Copy code
yaml
Variable Name: availableSlots
Type: Array
Extraction Prompt: Extract the available slots from the tool response.
You can then reference this variable in later nodes using
{{availableSlots}}
. For more details, see the workflows documentation on variable extraction and usage. Source: - [Workflows overview](https://docs.vapi.ai/workflows/overview)
f
@Vapi @Vapi Support Bot I also have this question. The link you shared has a warning "We no longer recommend Workflows for new builds. Prefer Assistants or Squads depending on complexity. See Assistants and Squads. This page is retained for legacy reference.". It recommends Assistants and Squads only. So as the OP asked, given this, "How to capture the tool’s response and assign it to a variable in the dashboard?"
v
Currently, the documentation recommends using Assistants or Squads instead of Workflows, but it does not provide a direct method for assigning a tool's response to a variable (like
{{availableSlots}}
) in the dashboard for these new approaches.
You can extract structured outputs and view them in the dashboard, but explicit variable assignment for use in later steps is not detailed in the found information. To better assist you: Are you specifically looking to reference the tool's response within a single call/session, or do you need to persist and reuse this data across multiple calls or flows? This will help clarify the best approach based on the current platform capabilities. For more on structured outputs in Assistants, see the [Vapi documentation](https://docs.vapi.ai/assistants/structured-outputs-quickstart). Source: - [Structured outputs quickstart](https://docs.vapi.ai/assistants/structured-outputs-quickstart)
f
I am specifically looking to reference the tool's response within a single call/session
c
Hey Hamza, you can find every tool's responses for each call/session in the full message history of the end-of-call report.
h
yeah but I needed the tool response in dashboard.
c
In dashboard too, you have call log section which shows exact tool response for each tool.
h
I meant to say that I want to inject the response in agent prompt. Is there a way to capture webhook response and later use that as {{variable}} in agent prompt.
c
No, there's no feature as such right now. What you can do instead is cache them on your own server, and inject them as variable on runtime. For outbound calls, you can directly pass them as variableValues, and for inbound, you can use https://docs.vapi.ai/assistants/personalization to send variableValues. To store the value of tools call in your server, you can use server url and capture tool call events.
h
When the bot gives phone numbers or email addresses, it’s too fast and doesn’t sound natural. Could we make it slower or clearer so people can actually understand it?
c
You can mention this in the system prompt. Voice models such as Cartesia and ElevenLabs support their own SSML tags (for example,
<spell>
and
<break>
). You can instruct your LLM to spell out numbers using these tags based on the voice provider you’re using.
h
During Voice call the agent provide the information like this "The responsible service technician is Möbel Service Polisterei Thomas Seifert. The phone number is to break time. 2 point fives. 1 break time at 0 point fives, 7 break time at 0 point fives, 0 break time is 0 point fives. 8 break time is 0 point fives. 6 break time is 0 point fives. For break time is 0.5. U break time is 0 point fives. Your break time in 12 point fives. Break time at all. 5 phase of 4. The email address is t as in tango break time 0.3 s k as in hotel break time, 0.3 is. O as in Oscar, break time, 0.3 years, m as in Mike, break time, 0.3 is g as in alpha, break time with 0.3 is t, e s as in Sierra, break time, of 1 5, break time So that's in Sierra break time. Sie tree s. IgG as" This is not the correct way to provide info, instead of pause it is saying breaktime The prompt I am using is attached as a text file. https://cdn.discordapp.com/attachments/1448993533636644895/1460888312943214796/message.txt?ex=6979b143&is=69785fc3&hm=7ac299efd9f3ba0dac5ae4973ac38ddd468620bfdc4b8fb6e0a07871309f6ffc&
c
Hey Hamze, it's due to- enableSsmlParsing is not enabled https://docs.vapi.ai/api-reference/assistants/create#request.body.voice.ElevenLabsVoice.enableSsmlParsing also
modelOutputInMessagesEnabled
needs to be
true
h
The "break time" issue has been fixed, but the agent is still not providing the information properly. For example, if the phone number is 01708640034, the agent skips some digits when telling it to the caller. Similarly, if the email is hamza@gmail.com, the agent only says the first few characters, like "h" pause "a" pause "m," and stops after 4–5 characters.
c
Can you share the call ID? It seems to be an issue with some ElevenLabs voice. Can you try the voice shown in the screenshot? https://cdn.discordapp.com/attachments/1448993533636644895/1461044023480418420/image.png?ex=69799988&is=69784808&hm=27dcef16c2ea25ba138e37953463b7c171dcdec790e1f68bb02e411ca731ad4a&
h
Call ID with Jennifer's Voice you mentioned to try: 019bbdb2-8ce6-7bb4-a62a-eaa71608f332 Call ID with my selected Voice: 019bbd25-c0f6-799c-aa95-7a2709ce0a0f The agent provides the email and phone number incorrectly. It goes silent on some characters, almost like when you try to speak but no sound comes out. I could not hear those parts at all - it became silent. I’m not sure whether the agent is skipping certain characters or if it is speaking them but the voice is failing to come through.
c
I am looking into this, will get back asap.
Hey Hamza, our technical team is looking into your issue for now. Can you try using the formatting plan by then- https://docs.vapi.ai/assistants/voice-formatting-plan Here we have a specific thing formatPhoneNumbers for this scenerio, please try that for now.
h
The formatting plan didn’t work very well, and the agent provides information too quickly, sometimes skipping digits in numbers or characters in emails.
Did your team analyze the call id's? Vapi currently supports SSML parsing only for 11Labs. What if we want to use another voice provider, such as "Cartesia" - how can we enable SSML parsing in that case?
c
You can directly use ssml tags in cartesia, I tried myself with new assistant and it works fine.
h
alright the phone number works fine but still the agent spells the email too fast and incorrectly
Hey Sarthak, can you help me with this? I’ve developed a multilingual agent that supports German (default), English, and French. The current setup works like this: - If the caller speaks English or French, the agent asks: “Would you like to switch?” - After confirmation, the agent switches to that language. This is working fine, but I want to refine the logic: ### Issue Right now, the agent asks for a language switch even if the caller says just one word in English or French (e.g., “Alright”, “Yeah”). I only want the switch prompt to trigger when the caller speaks 3 or more words in English or French. ### Example - Caller says: “Alright” → No switch prompt - Caller says: “Yes, I would like that” → Switch prompt appears Additionally, there’s a small complication: - When the caller says “Ja” (German for “Yes”), the transcriber sometimes interprets it as “Yeah” (English). - This incorrectly triggers the switch prompt, even though the caller is still speaking German. ### What I’ve Tried I added to the prompt: > “Only switch when the utterance contains more than 3 words.” But the agent still asks for a switch when single words like “Yeah” are detected. --- ### Question How can I enforce this rule so that: 1. The agent only asks for a switch when the utterance has 3+ words in English or French. 2. Prevent false triggers when German words like “Ja” are transcribed as English equivalents.
c
I would recommend different agents for different languages and combine them using squads. Instead of relying on automatic language detection (which is unreliable), use this approach: 1. Start with a German-only transcriber (no code-switching enabled) 2. Prompt the agent to detect explicit language requests from the user 3. Use Squad/transfer to switch to language-specific assistants when requested
Copy code
You are a multilingual assistant. Default language is German.

If the user explicitly requests to speak in English or French (using 3+ words like
"Can we speak English?" or "I prefer French"), ask them to confirm and then
transfer to the appropriate language-specific assistant.

Single words like "Yeah" or "Alright" should be ignored - continue in German.
The multilingual transcriber is always prone to miss pronunciations; it's either select a single language transcriber or improve the prompt to ignore false positives. The LLM is unable to handle this, even with a strong prompt, which means the LLM might be hallucinating, so it's also good to try with some different LLMs, for what performs better. There's also this webhook, https://docs.vapi.ai/server-url/events#language-change-detected, you might also use this to manually create a service that check last few transcript and decide whether to transfer or not.
h
How can I listen to the language-change-detected server event? I have already configured the server messages that are sent to the server URL, but I don’t see any server message related to language-change-detected. Alternatively, if I use a custom tool function, how can I listen specifically for this event?
c
My bad, after following up with the team, I found that this webhook is discontinued, as it was used when using the vapi transcriber, which is not the case now. Now the language change is handled by third-party transcribers. Will get the docs updated. Please look for the squad option I suggested; you can explore that. Many people have tried that and is working, also experiments with different LLMs.