Custom tools: pre flight fail and assistant call d...
# support
u
Hi, I'm new to vapi and i wanted to get the custom tools working for my assistant to use. I created a custom tool which i host locally at the moment (with ngrok of course). Now when I test my tool through the dashboard (without assistant), it would send a preflight request and my endpoint will get it but the dashboard will say the following Network error: Unable to connect to the server. This could be due to CORS restrictions, the server being down, or network connectivity issues. But when I assign this tool with the assistant, i can still see that im getting the request for the pre flight and then it would do a post request for the main data it needs and then i would send back this (i'm using nextjs) return NextResponse.json({ "results": [ { "toolCallId": callId, "result": "Here is my response to you. The value you need is: Johnny Sims" }, ] }, { status: 200 }) but the assistant does not seem to get the information. Thoughts on how to debug this?
v
Hey man, Do you have a CORS policy set up on your server? Setting CORS to all origins for testing should solve this error that's being thrown.
u
This worked. Thanks
v
Marking this ticket as Solved ✅
2 Views