Vapi tool call returning nested json rather than s...
# support
l
Hi there, I am unable to specify specific field as and output to the Vapi tools call. Right now it returns a long nested json file rather than just the "mc_number" required for Make API to consume as an input. I believe previously we had "body" and would be able to specify there. Could you help?
v
Hi there! 👋 I understand you're trying to get Vapi to return just the "mc_number" field instead of a nested JSON for Make API consumption. Based on the documentation I found, Vapi doesn't natively support extracting specific fields directly through tool call configuration. Instead, you'll need to transform the JSON response on your server side before sending it back to Vapi. Here's how you can approach this: 1. When your server processes a tool call request, format your response like this:
Copy code
json
{
  "results": [
    {
      "toolCallId": "call_Example",
      "result": "12345" // Just the mc_number value here, not a nested object
    }
  ]
}
The key is ensuring that the
result
field contains only the value you want (the mc_number), not an object [source](https://docs.vapi.ai/tools-calling). 2. You'll likely need to implement server-side logic to extract just the "mc_number" from your data before sending the response back to Vapi. Regarding the "body" parameter you mentioned - I couldn't find specific documentation about using a "body" parameter to select fields in Vapi tool calls. The current documentation focuses more on overall JSON structure and server interactions. Let me know if you need more help with implementing this solution! 😊 Sources: - [Vapi Tools Calling Documentation](https://docs.vapi.ai/tools-calling) - [Discord Channel Discussion on JSON Formatting](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334658296291921920) - [Discord Channel Discussion on Tool Call Issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1338507206051627073)
l
thank you!
k
Hey man, did this solve it for you?