Tool Calls (custom function)
# support
a
hello, I'm trying to use the Tools functionality. I have built a custom tool linked to an API endpoint. When I test a POST request with the following payload on Postman, I am able to correctly retrieve the information from the database. However, when I do the same via the assistant in Vapi, I get error 500. { "id": "call_test123", "type": "function", "function": { "name": "getCallsHistory", "arguments": { "customer_name": "John Smith" } } } I've also tried using a different payload structure: interface VapiRequestPayload { id: string customerName?: string } with this one, the status is 200 (success), however the call id is not included in the response, hence the assistant ignores the data and says it hasn't retrieved any information. I've reviewed this documentation: https://docs.vapi.ai/api-reference/webhooks/server-message#request.body.message.tool-calls but I couldn't figure out what am I doing wrong. Can anyone help? https://cdn.discordapp.com/attachments/1324728076831031417/1324728081981902982/Screenshot_2025-01-03_at_14.15.37.png?ex=677934ab&is=6777e32b&hm=71ae7937a426cd31d9723edf1681d4ffa28d8885e71e9da69770df0eded6b5a6&
s
@ARRR can you share the call id please?
a
call_ReHikEY3JcQEjMB9zB26YHWq
s
This is tool call id not call id, call id looks like this
3b469f52-3156-4296-a3c5-a41a18b0ac83
. You can get the call id from Vapi dashboard. 1. Goto Vapi Dashboard 2. Navigate to left side of dashboard (navbar) and look for logs > calls 3. Copy the Id under call ID. Make sure to share the recent call's call id.
a
c896cade-9fb0-4032-b2ee-4765b4faa5d3
I managed to fix it by myself. I'm pasting here the payload structure I used, in case it's of help to anyone else. interface VapiToolCallFunction { name: string arguments: { customerName?: string } } interface VapiToolCall { id: string type: string function: VapiToolCallFunction } interface VapiRequestPayload { message: { timestamp: number type: string toolCalls: VapiToolCall[] toolCallList: VapiToolCall[] toolWithToolCallList: any[] } }