certified dirtiboi
05/07/2025, 7:36 PMVapi Support Bot
05/07/2025, 7:38 PMjavascript
// Instead of this (problematic)
const result = JSON.stringify({
data: "multi-line content"
}, null, 2);
// Do this (better)
const result = JSON.stringify({data: "content"});
Tool calls expect string results without line breaks, as malformed JSON with breaks can cause parsing issues.
Sources:
- [Discord discussion about JSON formatting issues](https://discord.com/channels/1211482211119796234/1334658296291921920)
- [Discord discussion about tool call responses](https://discord.com/channels/1211482211119796234/1342176467714572400)Vapi Support Bot
05/07/2025, 7:38 PMjavascript
// Instead of this (problematic)
const result = JSON.stringify({
data: "multi-line content"
}, null, 2);
// Do this (better)
const result = JSON.stringify({data: "content"});
Tool calls expect string results without line breaks, as malformed JSON with breaks can cause parsing issues.
Sources:
- [Discord discussion about JSON formatting issues](https://discord.com/channels/1211482211119796234/1334658296291921920)
- [Discord discussion about tool call responses](https://discord.com/channels/1211482211119796234/1342176467714572400)Shubham Bajaj
05/08/2025, 5:18 PM