Issue: VAPI dashboard log viewer was showing tool call responses as a flat single-line string instead of an expandable, pretty-printed JSON object. The "Response Details" section was unreadable for debugging.
Root cause: My Cloudflare Worker was passing the result through JSON.stringify() before returning it to VAPI:
jsresults: [{ toolCallId, result: JSON.stringify(result) }]
This wrapped the response object as an escaped string inside the result field. VAPI's dashboard rendered it as raw text rather than parsing it back into an expandable JSON tree.
Fix: Pass the result object directly without stringifying:
jsresults: [{ toolCallId, result }]
Outcome: The dashboard now displays the response as properly formatted JSON with each field on its own line, e.g.:
{
"bookingTime": "Today at 9:02 AM",
"availability": "YES",
"latestAvailable": "Today at 9:00 PM"
}
The assistant continues to consume the tool result correctly during calls — no behavior change on the voice side, only improved log readability.
Note for VAPI's docs team: Their custom tools docs say result can be any data structure, while their troubleshooting page says it must be a string. The two pages contradict each other and should be reconciled. In practice, returning an object works and gives a much better debugging experience in the dashboard.