custom tool response failing
# support
k
Hi, I am creating a custom tool as it is not connecting to my google account, i have created the tool, and it works, but i am for some reason not able to get the fromating down. The tool responds in json that looks like this, which is what this documenation told me to do. So i am confused and need some help. For more info what happens is the tool and run succesfully, but the ai assiant says it is having tehcial issuses. So i am thinking it is the formating of the response, but not 100% sure. https://docs.vapi.ai/tools/custom-tools-troubleshooting?utm_source=chatgpt.com
Copy code
{
  "results": [
    {
      "toolCallId": "XXXXXX",
      "result": "Booking Status: Not Available. Reason: slot_taken. Message: That time is not available.. "
    }
  ]
}
a
Hey! I can help fix this. It sounds like the AI might be expecting a slightly different JSON structure or key names. I can review your tool response and adjust it so the assistant parses it correctly.
h
{{ JSON.stringify({ results: [ { toolCallId: $('Webhook2').item.json.body.message.toolWithToolCallList[0].toolCall.id, result: $('Edit Fields').item.json.message } ] }) }} try this json structure. We use this in n8n when we do tool calls from vapi.