Tool call result just shows 'success' rather than ...
# support
e
Call ID: 99edd5ee-bf3f-4280-9917-a3dc0db845cd **Goal**: I want the agent to make a silent (request-start = "") async tool call, and then insert the tool result into the conversation history for the agent to use. **Problem**: Tool call result just shows 'success' rather than the result For example in the Logs it shows the result was just 'success':
Copy code
{
  "name": "sense_a_teaching",
  "role": "tool_call_result",
  "time": 1739726889788,
  "result": "Success.",
  "toolCallId": "call_VgZodLjnnmiv2WtmvaoSFv6i",
  "secondsFromStart": 48.482
}
But in Make.com I can see that the webhook response had a full **result**:
Copy code
{
  "results": [
    {
      "toolCallId": "call_VgZodLjnnmiv2WtmvaoSFv6i",
      "result": "Ethan's quest for focus can be profoundly aided by understanding 'Being over Doing.' The ability to maintain focus isn't just about techniques, it stems from identity. What if Ethan saw himself not as someone *trying* to focus, but as someone who *is* focused?\\n\\nA practical step: Ethan can kill the identity of 'distracted worker' by literally declaring it dead. \"I AM killing the identity of the unfocused worker.\" Next, Ethan can define and embody the identity of 'focused achiever'. How would a focused achiever schedule their day? How would they react to distractions? By consciously embodying this new identity, he begins to live it. He can try intentional self-dialogue each morning to cultivate who he will be for the world throughout the day ahead. He can then welcome what conflict arrises within.\\n\\nIntense work followed by breaks, then, becomes not a forced strategy, but a natural expression of this new, focused identity. This is sustained focus, born from 'being'.\\n"
    }
  ]
}
v
Hello Ethan, Setting the “async” property to true for a tool means that it will trigger the functions without waiting for their responses. Therefore, to use the “call response” feature of the tool, you need to set the “async” property to false.
v
✅ Ticket status updated to solved by Vapi Ticket Bot#0124
e
Thanks @Shubham Bajaj - is it possible to have the async response inserted into the conversation history in the background?
v
No Ethan, it's not possible to have async response inserted into conversation history but you can use live call control url to insert the message by yourself with role assistant.
e
Ah I see, thank you - I'll look into that 🙏
Hi @Shubham Bajaj I'm using the Vapi Web SDK How I do make this request to get the controlUrl please? I understand I need to send a POST request to the /call endpoint - my questions are: 1) What values do I put in the POST request? (I'm calling vapi.start to create an assistant so there's no customer number or phoneNumberId) 2) Where do I get these values from? Like do I need to pass one of these when I call vapi.start() to get the assistantId?
Copy code
"serverMessages": [
    "phone-call-control"
  ],
Copy code
"clientMessages": [
    "metadata"
  ],
Thank you!
Copy code
Obtaining URLs for Call Control and Listen
To initiate a call and retrieve the listenUrl and controlUrl, send a POST request to the /call endpoint.

Sample Request
curl 'https://api.vapi.ai/call/phone' 
-H 'authorization: Bearer YOUR_API_KEY' 
-H 'content-type: application/json' 
--data-raw '{
  "assistantId": "5b0a4a08-133c-4146-9315-0984f8c6be80",
  "customer": {
    "number": "+12345678913"
  },
  "phoneNumberId": "42b4b25d-031e-4786-857f-63b346c9580f"
}'
s
1. First, ensure monitoring is enabled in your assistant configuration:
Copy code
typescript

const assistant = {
  monitorPlan: {
    listenEnabled: true,  // For live audio streaming
    controlEnabled: true  // For live control capabilitie
  }
};
2. When creating a phone call, you'll receive a response that includes monitor URLs: // call.monitor.listenUrl - WebSocket URL for live audio // call.monitor.controlUrl - HTTPS URL for live control 3. To control the call, you can send messages to the controlUrl:
Copy code
typescript
await fetch(call.monitor.controlUrl, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    type: 'add-message',
    message: {
      role: 'tool',
      content: 'Your tool result here'
    }
  })
});
@Ethan Tan let me know if you require further help.
e
thanks @Shubham Bajaj What's the difference between that controlUrl call and the send call below, please? --- .send() During the call, you can send intermediate messages to the assistant (like background messages).
Copy code
type will always be "add-message"
the message field will have 2 items, role and content.
**vapi.send({ type: "add-message",** message: { role: "system", content: "The user has pressed the button, say peanuts", }, }); Possible values for role are system, user, assistant, tool or function. ---
hi @Shubham Bajaj , following up on this, thank you
s
@Ethan Tan Control URL is a webhook-based method for controlling the current call flow, while the Send method does the same process under its wrapper. You can use either method depending on the call medium (web or phone).
@Ethan Tan Apologies for the delay due to a bandwidth issue. I was unable to work on this. If you would like me to delve into the matter, it may take some additional time. In the meantime, you can explore the open-source code and attempt to identify any issues. I can assist you with further resolution on our backend code if required.
2 Views