Assistant not reading Tool Call Response
# support
a
I have created a tool with the type set to "make" Upon call initialization, I aim to retrieve the user's name and email from HubSpot. The webhook is successfully triggered; however, the assistant is unable to process the returned data. The data I sent back in webhook as follows: {   "results": [     {       "toolCallId": "{{2.message.toolCalls[].id}}",       "result": {         "email": "ali@gmail.com",         "firstname": "Ali",         "lastname": "Hassan"       }     }   ] } I would appreciate guidance on ensuring the assistant can correctly interpret and utilize this data. https://cdn.discordapp.com/attachments/1349016155913719931/1349016156370894878/image.png?ex=67d190b3&is=67d03f33&hm=ae49b4b017fdf89f80456fe822b976607fce9b760a91a817986e2a31e71e3078&
v
Hi Ali! I see you're having trouble with your Vapi assistant processing data from your webhook. Looking at your JSON structure, I've identified a few potential issues: 1. **Tool Call ID Format**: The
toolCallId
value appears to be using a template variable:
{{2.message.toolCalls[].id}}
. This should be replaced with the actual tool call ID from the request. The assistant needs the exact ID to match the response with the original call [(source)](https://docs.vapi.ai/tools/custom-tools). 2. **JSON Structure**: While your overall JSON structure looks correct with the
results
array containing objects with
toolCallId
and
result
fields, ensure you're not transforming arrays to strings during serialization [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1330221332452999321). 3. **Content-Type Header**: Make sure your webhook response has the
Content-Type
header set to
application/json
so Vapi knows how to parse the incoming data [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1330221332452999321). 4. **Testing and Verification**: Try testing your webhook manually using tools like Postman to ensure it works as expected. Check both Vapi and Make.com logs for any errors or misconfigurations [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1336345690393149452). 5. **Dynamic Variables**: If you're using dynamic variables like
userId
, make sure they're correctly implemented in your Vapi SDK configuration [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1339495894801711186). Let me know if you need more specific guidance on any of these points! 🛠️ Sources: - [Vapi Tools Documentation](https://docs.vapi.ai/tools/custom-tools) - [Discord Channel Webhook Configuration](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330221332452999321)
a
@User !
m
Hey @Ali Fawad Hassan , just to clarify, it's getting the tool result but not speaking it correct?
a
Hello @Mason , Yes. As shown in the attached snippet, I have a make.con scenario triggered by the Assistant. Its a tool call function where I return the first name, last name, and email. However, the Assistant still does not respond correctly.
m
I hear you boss, can you elaborate on what you mean by responding correctly
a
As i return the user details using the tool, but once i ask the assistant what my name or email is, the assistant responds with random email and name instead of provided name and email in tool
m
What LLM are you using?
a
OpenAi
Gpt-40-mini
m
No worries, can you provide me some call IDs and I'll make sure I follow up with you with a cause and a fix.
a
call_PD3blPOddNzI70r0EQXpOwj7
call_CAYAlPmWGx8Pzoqctb2w3pBv
m
I don't believe that's a Vapi call ID. You can find them here: https://dashboard.vapi.ai/calls
a
6bc0f47b-6f1f-4521-bbf9-f4a8a4b641f0
c33535f8-e6d0-484c-8ecc-8a86797b5af2
c6c30f1c-9fce-440c-aeac-cc4efeee8084 @User
s
Can you do me a favor, remove the tool success message, test one more call and provide me that call ID
d
@Ali Fawad Hassan were u able to fix it? I have same issue
Nope.
It works this way. But we need to disable the async functionality, it was not working when async was enabled. { "results": [ { "toolCallId": "{{2.message.toolCalls[].id}}", "result": "caller username is {{3.properties.firstname}} and caller last name is {{3.properties.lastname}}" } ] }
m
Hey @Ali Fawad Hassan , were you able to remove the tool success message and test?
a
@Mason i tried this 69e8e597-e6c8-4c48-a558-4d6c44e59d19
@Mason It's working now! I tried to pass string, instead of object. and it works. However, one issue I'm facing is that upon call initialization, I trigger the tool function. Yet, every time the tool is triggered, the assistant responds with 'Hold on,' 'One sec,' or similar phrases. Even though I have explicitly instructed the assistant in the prompt not to inform the user about the tool function being called, it still does so.
m
🎉🎉 glad to hear it’s fixed my man
That’s because it’s not the LLM generating that message it’s a manually spoken message set under your tool settings. Look for request start message there
a
Thanks
The tool i have created is just a simpler function, to grab user details. But still on call initialization, assistant said "hold on" , even i don't mention it anywhere @User https://cdn.discordapp.com/attachments/1349016155913719931/1349996247972319242/image.png?ex=67d5217b&is=67d3cffb&hm=5ea781723b290274e21bedabb3c2d8fe043781e9abecced6d3e3a32df85f7ba7&
s
Hello Ali, what you're experiencing is the default tool start message. If leaving it blank is not working I would recommend putting a "." in the request start message of the tool.
a
Thanks, it works.
s
Nice!!! Glad to hear that.
3 Views