function called but "unexpected error"

I have defined a very basic function:
  • launch-rocket: This function launches a rocket. Call it to launch a rocket.
I'm building in-browser with the web SDK. I intercept the function call with vapi.on('message', ...) so I haven't added an url or any properties to the function.

When I ask, "please launch a rocket", the function is called successfully but so far 100% of the time it is followed by "An unexpected error occurred." making the voice agent assume something went wrong (even tho the function was called fine).

Example transcript:

Hi. I'm a voice agent. How can I help?
Please launch a rocket
---> launch-rocket is called
"An unexpected error occurred."
Hold on a sec. It seems there was an error with launching the rocket. Is there anything else I can assist you with?


I can't figure out how to debug this, can someone point me in the right direction?
Was this page helpful?