tool-calls and tool-calls-result messages
# support
p
My team is working on building a voice agent for web, iOS and Android. We are looking at [this documentation](https://docs.vapi.ai/tools/client-side-websdk) which would give us the ability to keep the client in synch with our assistant by using vapi.addMessage to send data to Vapi and receive data via tool-calls and tool-calls-result messages. However, what we are seeing in practice is that tool-calls and tool-calls-result messages are not reliably sent for each tool invocation. We can see that the tools are being called but messages are not being received by the client. Anyone else in the community trying to do something similar. If so, how are things going? Anyone from Vapi: I would be happy to point you to our assistants and also to call logs where we got unexpected results.
v
Thank you for sharing the details. To help diagnose the issue, could you specify which SDK version(s) you are using for your web, iOS, and Android clients? This will help determine if the problem is version-specific or platform-related. Sources: - [Client-side tools (Web SDK) documentation](https://docs.vapi.ai/tools/client-side-websdk) - [Custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting) - [Debugging voice agents](https://docs.vapi.ai/debugging)
p
@Vapi Support Bot we are using VAPI Web SDK version 2.5.2
v
To ensure reliable receipt of
tool-calls
messages in the Web SDK, double-check that you are starting the call with the
clientMessages: ['tool-calls']
option and have a listener for
message.type === 'tool-calls'
. Here’s a minimal example:
Copy code
javascript
vapi.start({
  // ...other config
  clientMessages: ['tool-calls'],
});

vapi.on('message', (message) => {
  if (message.type === 'tool-calls') {
    // Handle tool call here
    console.log('Tool call received:', message);
  }
});
This setup is required for client-side tool-calls to work as described in the [documentation](https://docs.vapi.ai/tools/client-side-websdk). Source: - [Client-side tools (Web SDK) documentation](https://docs.vapi.ai/tools/client-side-websdk)
p
clientMessages is part of assistantOverrides, correct? If so , I believe I am already passing the correct options
c
Hi Pete, Could you share Call IDs where you faced this issue? Furthermore, if your client is not receiving any client messages, please check with your assistant configuration, and make sure you enabled
tool-calls
and
tool-calls-result
messages are enabled. If you are using
assistantOverrides
and instead of setting clientMessages in the assistant page. Please check your dev tools network page for the
POST https://api.vapi.ai/call/web
request, and please share the request JSON here for more details. This will help me figure out the issue you are facing.