Anyone having issues with function tool
# general-english
m
Anyone having issues with function tool calls? I am simply just trying to have an aysnc tool call to collect information and send it to a webhook but the information never gets collected properly
j
Which system do you want to be sending the tool call result information to the webhook ?
m
I am sending it to an n8n workflow which will then process and send the information to a crm. This n8n workflow is configured properly to catch a post request and return the properly formatted response.
j
sorry, maybe I didn't explain myself. Are you expecting vapi to call the webhook after the tool cal . Or is it you tool the one calling the webhook ?
u
Did you crosscheck all the parameter settings? And where the tool is called in the prompt?
m
Vapi tool will post data to the n8n webhook. The tool is called at the end of the call within the prompt. It is just sending the information of the caller. here is the config of the tool { "id": "950b43e0-ef86-44a1-9da9-a45e93a246e4", "createdAt": "2025-05-02T15:43:19.348Z", "updatedAt": "2025-05-05T15:52:18.456Z", "type": "function", "function": { "name": "logLeadToCRM", "strict": false, "description": "Log a qualified lead to CRM. ", "parameters": { "type": "object", "properties": { "name": { "description": "The name of the caller", "type": "string" } }, "required": [ "name" ] } }, "orgId": "9d1d8b58-85cc-485d-9406-cb08ab846701", "server": { "url": "https://testdomain.com/webhook/voice-agents/tool-calls/new-lead", "headers": {} }, "async": true }
I changed out the domain
j
Then likely the problem is that the tool is not being called. There are some listeners for the end of call so that you can send conversation data to your servers and then store in the CRM. I haven't done it myself
m
I see the tool being called at the end. One moment ill screenshot
j
And is your server receiving the call ?
m
Nevermind you are right its not calling the tool
j
😄
m
Any idea on what i can do to fix this?
j
Use the dedicated webhooks for conversation-end. check 'messages' in the assistant config
m
Would this still collect information that i set it to? For example name?
j
not sure about that. Likely you will need to process the conversation with openai to get all the information then call n8n
m
Hmm. I think i still just need to find a way to use tool calls since it is supposed to handle all of that and i definitely need this functionality in the future. Triggering a webhook post call and passing the transcript through openai would only be a temporary fix.
We are migrating the agent over from eleven labs and the tool calls work great on there. I was hoping it would work the same way here
j
tool calls doesn't relly work well in vapi. Specifically if you have several parameters in the request
I needed to create tools that just have at most 2 params , then use openai to extract from those params the real json to be used in my system. Also, I developed a fallback mechanism as if the arguments of the tool call are empty ( sometime vapi randomly decides to send empty arguments when the user request is long )
So in general, tool calls are far from being solid in vapi. And if you do want to use vapi, you need to do a lot of hacks
Like for example mapping snake case to camel case "just in case"
m
Eleven labs is similar in that way. The only issue that ive had so far is specifically with these "function" calls. The transfer and query calls work great. It just seems like it struggles to collect info as it comes in
j
Good luck friend, if you need any other help, I'll be happy to assist
s
@msampino 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! ccing: @Kings_big💫
m
Hi @Shubham Bajaj Sent this info in my support ticket here https://discord.com/channels/1211482211119796234/1368946992717238343
2 Views