liamdu386
05/19/2025, 9:26 PMVapi Support Bot
05/19/2025, 9:28 PMrequest-failed
message type, like this:
json
"messages": [
{ "type": "request-complete", "content": "Order placed successfully." },
{ "type": "request-failed", "content": "Sorry, there was a problem placing your order." }
]
Then, adjust your server logic so that when an error occurs, the result is structured in a way that triggers the request-failed
path (e.g., by returning a recognizable error string or object). This helps the assistant pick up failures correctly.
[See documentation for details](https://docs.vapi.ai/tools/custom-tools#adapting-the-payload-for-your-needs)
Source:
- [Custom Tools – Adapting the Payload for Your Needs](https://docs.vapi.ai/tools/custom-tools#adapting-the-payload-for-your-needs)liamdu386
05/19/2025, 9:35 PMliamdu386
05/19/2025, 9:35 PMliamdu386
05/19/2025, 9:36 PMAditya
05/20/2025, 7:33 PMliamdu386
05/21/2025, 8:02 PMliamdu386
05/21/2025, 8:04 PMAditya
05/22/2025, 6:15 AMresults
array
2\. Use the error
field instead of result
for error messages
Your message configuration is correct - this change in response format will ensure the appropriate "request-failed" message is triggered.Aditya
05/22/2025, 6:15 AM