Tool execution returning "An unexpected error occu...
# support
a
We are seeing "An unexpected error occurred." in tool executions, in a call detail, but when debugging the tool execution in our own API (the tool is a webhook to our API), POST was successful. This is the call: { "toolName": "xxxxx-send-to-ringba-sd", "startTime": "2025-08-13T20:22:30.893Z", "toolCallId": "call_MIvDSuDIWYBC8WcMSoNh9g57", "toolResult": "An unexpected error occurred.", "vapiCallId": "a06ab406-bbd5-46b4-925c-d94ff2ec05ae", "toolArguments": "{}" } Whats happening? Whats that "An unexpected error occurred."? We dont return that error in our API. What failed? Is your system not doing properly the tools that fetch APIs?
c
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
Everything is answered in original message. Have you read?
c
Thank you for providing that info. We will review the logs and get back to you with an update
Looking at the call messages, the AI assistant was following this script flow: **Step 1**: Execute guayaba-send-to-ringba-sd() **Step 2**: "immediately after without waiting for confirmation" execute guayaba-transfer-call-keeping-contact-number() The prompt specifically instructs: > "Immediately execute tool guayaba-send-to-ringba-sd() and then immediately after without waiting for confirmation execute tool guayaba-transfer-call-keeping-contact-number()" This instruction caused the AI to fire both tool calls in rapid succession, triggering the safety mechanism that prevents overlapping tool executions. To fix this issue, the script should be modified to either: 1. Wait for the first tool call to complete before executing the second 2. Use a single tool call that handles both operations 3. Add a small delay between the tool calls to prevent the race condition
2 Views