Log Viewer NOT expanding tool Results
# support
l
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.
v
It's great to hear that you identified the root cause and resolved the log viewer issue! Passing the result object directly instead of stringifying it definitely makes the dashboard much more readable and useful for debugging. Your note about the documentation inconsistency is also very insightful—having clear and consistent guidance is important for a smooth developer experience. Thanks for sharing your findings and solution!