Structured Data ignores tool_call_result payload (...
# support
g
Structured Data is enabled and webhook returns 2xx, but SD does not use fields from the last tool_call_result. Even with a single-unit result containing contract_type = sale, SD outputs unknown unless the assistant explicitly says “in vendita/sale” in its reply.
v
Looks like your structured data isn’t pulling in the contract_type = sale from the tool result, even though the webhook is fine. I can help you dig into why it only shows up when the assistant says it directly. Have you checked if the schema mapping might be overriding the tool output?
@User
g
this is the call_id -> 84edc8b9-9cf0-46b5-bc6d-cbcb7a640163
v
Thanks for sharing the call ID and structured data. I can help directly by reviewing how your SD schema interacts with the assistant output, checking the last tool_call_result mapping, and adjusting the extraction logic so contract_type = sale is captured reliably. It’s best to continue this privately so I can implement the fix in your setup and ensure consistent results.. @giodea
g
Solved using structured output - not data. Api only
c
Hi giodea, It seems you're experiencing some issues with your tool calls returning IDs in structured data or being referenced by your assistants. Here’s a quick guide to diagnose and resolve common problems: 1. **Tool Call ID Mismatch**: Ensure that the
toolCallId
in your response matches exactly with the ID from the request. Any mismatch can cause the response to be ignored. 2. **Correct JSON Structure**: Your webhook should always return a JSON structure with a
results
array. Here’s a response format template:
Copy code
json
   {
     "results": [
       {
         "toolCallId": "call_123",
         "result": "Your response as a single-line string"
       }
     ]
   }
Make sure to check for line breaks in responses, which can cause parsing errors. Use single-line strings. 3. **HTTP Status Code**: Always return HTTP 200, even for errors, with details inside the
results
array. 4. **Schema Validation**: If you have schema validation enabled, check your call logs for "Schema validation errors" which indicate missing required parameters or incorrect schema definitions. 5. **Structured Outputs**: Ensure your structured outputs are configured correctly in your API or dashboard. They should be attached to an assistant and configured to extract and return the correct data structure. You can review detailed troubleshooting steps and response templates [here](https://docs.vapi.ai/tools/custom-tools-troubleshooting). Let me know if there's anything else you need help with.
2 Views