Gerald
04/14/2025, 7:22 AMVapi Support Bot
04/14/2025, 7:24 AMjson
{
"results": [
{
"toolCallId": "<your-tool-call-id>",
"result": "Your actual result here"
}
]
}
If you're just returning the raw API response or not formatting it correctly, the assistant might not be able to parse it properly. According to [documentation on tool responses](https://docs.vapi.ai/tools-calling), the result
field should be a properly formatted string without nested JSON or unescaped line breaks.
### 2. The "Success" Message Issue
When you see just "Success" instead of the actual fare amount, this is a common issue mentioned in the documentation. According to [information about common parsing issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1340737584309211136), the tool call result might show "Success" rather than the actual result if the response isn't being properly processed.
### 3. Currency Conversion Logic
For the incorrect dollar amount ($2 instead of $1.45), this could be related to how the assistant is interpreting the cents value. The assistant might be:
- Misinterpreting the value as dollars instead of cents
- Rounding the value incorrectly
- Not applying proper formatting for currency values
### Debugging Steps
Here are some debugging techniques you can try:
1. **Verify your response format**: Ensure you're returning the correct JSON structure with the proper toolCallId
from the incoming request.Vapi Support Bot
04/14/2025, 7:24 AMsynchronous
instead of async
if you need immediate results.
3. **Implement explicit conversion logic**: Make sure you're explicitly converting cents to dollars in your response. For example:
javascript
const fareInDollars = (totalFare / 100).toFixed(2);
4. **Inspect the logs**: Look at the logs associated with your call ID to see exactly what's being sent and received.
5. **HTTP status code**: Always return a 200 status code to ensure the result is retrieved properly.
Would you be able to share more details about how you're formatting the response from your API before sending it back to the assistant? That might help pinpoint the exact issue.
Sources:
- [Common issues with parsing toolCall results from APIs](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1340737584309211136)
- [Debugging techniques for toolCall result parsing errors](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342315282198298729)
- [Tool response format documentation](https://docs.vapi.ai/tools-calling)Gerald
04/14/2025, 7:35 AMKings_big💫
04/14/2025, 7:50 AMGerald
04/14/2025, 7:58 AMKings_big💫
04/14/2025, 8:11 AMGerald
04/14/2025, 8:23 AMGerald
04/14/2025, 9:54 AMKings_big💫
04/14/2025, 10:02 AM