tool call response not working
# support
j
I am sending back a response for a tool call request received to my server. Verified that the request is received, processed and a response is returned successfully. As per the docs there seem to be two different ways to do that- 1. tried my luck with https://docs.vapi.ai/api-reference/messages/server-message-response
Copy code
{
  results: [
    {
      message: [
        {
          type: "request-complete",
          role: "assistant",
          content: "Next monday at 5 pm is available",
        },
      ],
      toolcallId: "call_1pKJtgLbpRFh62GneSHKnlvT",
      name: "eb46446a-4d83-4ac1-b8e6-375f58bc0ebe",
    },
  ]
}
But didn't succeed The result in call logs looked something like this
Copy code
{
  "name": "eb46446a-4d83-4ac1-b8e6-375f58bc0ebe",
  "role": "tool_call_result",
  "time": 1726827031345,
  "result": "No result returned for call_1pKJtgLbpRFh62GneSHKnlvT.",
  "toolCallId": "call_1pKJtgLbpRFh62GneSHKnlvT",
  "secondsFromStart": 16.665
}
2. Tried the 2nd way as per the way mentioned here https://docs.vapi.ai/tools-calling#server-response-format-providing-results-and-context
Copy code
{
  results: [
    {
      toolcallId: "call_tQkt0YJ4Yc1ENiMPf1V0zWUS",
      result: "Next monday at 5 pm is available",
    },
  ]
}

{
  "name": "eb46446a-4d83-4ac1-b8e6-375f58bc0ebe",
  "role": "tool_call_result",
  "time": 1726827154782,
  "result": "No result returned for call_tQkt0YJ4Yc1ENiMPf1V0zWUS.",
  "toolCallId": "call_tQkt0YJ4Yc1ENiMPf1V0zWUS",
  "secondsFromStart": 11.738
}
Both didn't work for me. Would be grateful if someone could help me out
v
message has been deleted
@jit I'm here to help! It looks like there might be a small issue with the format of your JSON response. JSON keys and string values should be enclosed in double quotes. Let's correct the format and try again. Here's how your response should look:
Copy code
json
{
  "results": [
    {
      "toolCallId": "call_tQkt0YJ4Yc1ENiMPf1V0zWUS",
      "result": "Next monday at 5 pm is available"
    }
  ]
}
Please ensure that you're using double quotes and that the
toolCallId
matches the one you received in the HTTP request. Once you've made these changes, try sending the response again. If you continue to encounter issues, please ask support for more info on this.
You can continue this conversation by mentioning me in the message.
j
issue not resolved
@User
s
@jit call id please.
j
here @Shubham Bajaj callId - edab87f4-8624-4eae-b809-4972d95f04be
s
@jit can you try now?
j
Yes it worked! Thanks!
5 Views