Failed Tool call is not showing Error in the Dashb...
# support
a
I have implemented a tool call in Vapi, and returning the following response in case of success and Failure: If TOOL CALL returns success I am sending the following response: result = result_object.get('message', 'Attorney listing request created successfully') tool_response = { "toolCallId": tool_id, "result": result, } ELSE: result = result_object.get('message', 'Failed to create attorney listing request') tool_response = { "toolCallId": tool_id, "error": result, } My API is returning the following response: {'success' : False, 'message' : "Invalid legal problem: Civil Hearing" } Dashboard is showing the following: { "name": "cs_find_attorney_listing", "role": "tool_call_result", "time": 1775085830532, "result": "Invalid legal problem: Civil Hearing", "metadata": {}, "toolCallId": "call_JIdBU918nG7M5z7w7a5BVlVc", "secondsFromStart": 57.701 }
v
To fix the error display in the Vapi dashboard, always wrap your tool call response in a
results
array, even for errors.
Here’s the correct format for an error response:
Copy code
python
return {
    "results": [
        {
            "toolCallId": tool_id,
            "error": result_object.get('message', 'Failed to create attorney listing request'),
        }
    ]
}, 200  # Always return HTTP 200
This will ensure errors are shown properly in the dashboard. Reference: [Vapi custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting) Source: - [Vapi custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting)
a
@User @User
s
Hi, thanks for reaching out.
We're looking into this and will soon get back to you.
Hi, Thanks for sharing the details and the call logs - we checked the behavior, and here’s what’s happening.
When a tool call returns an error using:
Copy code
js
    { "toolCallId": "...", "error": "your error message" }
Vapi processes it correctly, but in the dashboard the error message is shown under the result field. This is expected for now. The conversation history format (tool_call_result messages) does not include a separate error field, so any error text is mapped into result for display purposes. Important notes: • Your tool logic is working correctly - the assistant receives the error message properly. • The dashboard display is cosmetic and does not affect tool behavior. • Success responses will continue to appear normally under result. We understand this can be a bit confusing, and we have an internal task open to improve how errors are represented in the dashboard.
a
Thanks!
s
no worries!
if you face any further issues, feel free to create a new ticket