In tools, call id is not getting passed
# support
a
I'm using the api_request_tool as a tool in a VAPI Assistant, let's say named track_user, where I want to pass the call ID. However, I'm receiving responses like {"vapi_call_id": "undefined" or "1", "is_interested": true}. I want the call ID to be the one obtained from the /call endpoint.
@User Please help me to fix this issue.
c
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!
a
Call ID: 766203cd-7933-45dd-bfe8-0feac654a4d5 Time: 06/10/2025 10:16:02:755 (+5:30 GMT) Expected response: {"vapi_call_id": "766203cd-7933-45dd-bfe8-0feac654a4d5", "is_interested": true} Actual: {"vapi_call_id": "1", "is_interested": true}
We have to make it live today 😊, Kindly look into.
c
In vapi_call_id in your custom tool, use the value {{call.id}}
a
{'role': 'assistant', 'tool_calls': [{'id': 'call_Ggjo6LSONf319VQ02jFjaggz', 'type': 'function', 'function': {'name': 'track_user_interested', 'arguments': '{\n "vapi_call_id": "{{call.id}}",\n "is_interested": true\n}'}}, {'id': 'call_dEUIW1wHIpRUOumudWewzWC6', 'type': 'function', 'function': {'name': 'send_whatsapp_message', 'arguments': '{"vapi_call_id": "{{call.id}}"}'}}]} https://cdn.discordapp.com/attachments/1381940898698498138/1382218227521687673/Screenshot_2025-06-11_at_10.07.53_AM.png?ex=684a5a89&is=68490909&hm=7418f77605802c3a8e6eb834140d47437ca2853e157872b359a08ffe98b2c2bf&
I also tried passing
{{call_id}}
as a query parameter, but it still didn't work.
@User Please look into
c
Here Aditya, you get VAPI call ID as part of server message tool called payload. So you don't need to extract or pass it separately. With your current approach, it doesn't work because the prompt or the assistant doesn't know what's the VAPI call ID and that's why it couldn't send you anything despite from a regular or a default value. So use server message tool called payload to extract the VAPI call ID and to continue processing your tool call. Let me know if you still require further help with this.
2 Views