Function Call only works the first time.
# support
x
I'm using VAPI and the model I use is Mistral (connected my API in the Provider Keys). I’ve defined two tools in VAPI that are forwarded to my n8n backend workflow: checkAvailability createBooking The first tool call works perfectly. The Mistral model returns a structured tool_call, which VAPI executes and forwards to n8n. However, when the user proposes a new time (e.g., if the slot is unavailable), and the model tries to call checkAvailability again, VAPI does not forward it. Instead, it speaks a corrupted tool message like: "ToolCall id gHnRWgWub, function checkAvailability..." …and no call reaches n8n. Also, if, for example, the slot is available, then it goes through, and everything works fine.
v
I've escalated your issue to our technical support team for further investigation. This appears to be a specific integration issue between VAPI, Mistral, and n8n that requires deeper technical analysis. Based on our documentation, this could be related to several potential causes: - A possible bug in how VAPI handles subsequent tool calls with Mistral - Issues with the JSON response format and
toolCallId
handling - Known integration challenges with Mistral Other users have reported similar issues where tool calls only work the first time. In one case, the issue was eventually resolved by the VAPI team. While you wait for our technical team to get back to you, you might try: - Checking the JSON response format from n8n to ensure it follows VAPI's expected structure - Reviewing your VAPI webhook logs to see if there are any error messages - Testing if the issue occurs with a different LLM provider if possible Our support team will contact you shortly with more specific guidance. Thanks for your patience! 🙏
s
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
x
Call ID: 7ab9823d-a741-4b15-9184-fe0e4f270b55 Timestamp Apr 7, 2025, 02:28 (1minute 20 seconds call duration) I expected it to check the availability for the new date and time but instead of using the Tool and Triggering the Webhook it started saying "Tool Call Function ssksddj...." some gibberish instead of calling the tool This only happens if it needs to check availability again (when the first date and time is not available). If thats not available the Assistant says something like „Unfortunately there is no free table at the given time and date. Please choose another time or date“ and then when I say the time and it reads it back to me to confirm it, after confirming it goes „Okay I am going to check it, Tool Call dhsldudbe …..“ and then goes silent and stops responding. Side Note: This should be a Booking Agent/Receptionist so it should check Availability -> if available -> createBooking which works But if not available -> it should checkAvailability again for the new time which does not work And the n8n workflow seems to work fine no issues with that. If you need more information please let me know. (Btw it is important for me to use Mistral because of some GDPR compliance related things)
Does anyone have any recommendations for what the issue might be here? As I mentioned before if you need further details please let me know!
s
looking into it.
This is happening because of the Mistral LLM tool call messages format where we have to append those results inside the messages array. After the first tool call, when we append the content, the LLM voices out or generates the content which eventually results into the issue you are mentioning. As of now, the primary suggestion to unblock yourself is to change the LLM. If you cannot do on that part, I'll suggest the second thing to use the custom LLM. If you still cannot do on that part, I'm keeping the ticket open with me. I'll check with a team what else can we do or if it's in our side.
🔵 07:29:50:359 MistralRequest Request. Messages: \[ { "role": "system", "content": "# Rolle:\\nDu bist Sarah, eine KI-basierte Tischrese..." }, { "role": "assistant", "content": "Vielen Dank für Ihren Anruf bei Gasthaus Billinger. Ich bin ein KI Tischreservierungsassistent. Wie kann ich Ihnen behilflich sein?" }, { "role": "user", "content": "Ja hallo, ich möchte gerne einen Tisch reservieren für heute um 12 Uhr." }, { "role": "assistant", "content": "Vielen Dank für Ihre Anfrage. Sagen Sie mir bitte Ihren Nachnamen und wie viele Personen kommen werden." }, { "role": "user", "content": "Herr Steiner um 12 Uhr. Was für 3, 5, 5, 5." }, { "role": "assistant", "content": "Ich fasse noch mal zusammen. Sie möchten heute um 12 Uhr für 5 Personen auf den Namen Steiner reservieren? Ist das so korrekt?" }, {"role": "user", "content": "Ja, das ist korrekt."}, { "role": "assistant", "content": "Ich überprüfe nun die Verfügbarkeit, Tool calls: \[{\\"id\\":\\"yvJBXhWBP\\",\\"type\\":\\"function\\",\\"function\\":{\\"name\\":\\"checkAvailability\\",\\"arguments\\":\\"{\\\\\\"requestedTime\\\\\\": \\\\\\"heute 12 Uhr\\\\\\"}\\"}}\]" }, { "role": "user", "content": "Tool result for yvJBXhWBP: Es tut mir leid aber an diesem Tag zu dieser Uhrzeit ist leider kein Tisch mehr frei. Bitte nennen Sie mir eine andere Uhrzeit oder Tag und ich werde überprüfen ob wir einen freien Tisch haben." }, { "role": "assistant", "content": "bitte um einen kurzen Moment. Leider ist heute um 12 Uhr kein Tisch mehr frei. Möchten Sie einen anderen Termin wählen?" }, { "role": "user", "content": "Ja, achter April um 11 Uhr Vormittag." } \]
a gentle reminder to continue this thread.
x
Thank you for the information. It just seems weird to me since Mistral is an “out-of-the-box” option for VAPI, that it doesn’t work. I also tried to define in the system prompt how it should respond (correct json format for the tool call) but nothing worked. It would be nice if Mistral would work that would be huge for the EU Community I think 🙂
s
Will relay this to the team.
x
Thank you Sahil!
Did you hear anything from the team yet? 🙂
s
It is an LLM issue. If you use the openai llm you won't face any issue with it like I know this is not what you are looking for but that's the thing with Mistral model. It is not pretty good in-terms of tool calling.
x
Hmm okay what else would you recommend for Gdpr compliance?
s
We recommend GPT-4O as an LLM, independent of compliance.
correct me if I understood you wrong.
2 Views