Client-side Tools (Web SDK)
Client-side Tools (Web SDK)
Handle tool-calls in the browser without a server URL
Client-side Tools (Web SDK)
Handle tool-calls in the browser without a server URL
Use the Web SDK to handle tool-calls entirely on the client. This lets your assistant trigger UI-side effects (like showing notifications or changing state) directly in the browser.
In this guide, you’ll learn to:
tool-calls events on the clientaddMessageClient-side tools cannot send a tool “result” back to the model. If the model must use the output of a tool to continue reasoning, implement a server-based tool instead. See: Server-based Custom Tools.
To make a tool client-side, simply do not provide a server URL. The tool specification is delivered to the browser, and the Web SDK emits tool-calls messages that your frontend can handle.
model.tools array and subscribe to clientMessages: [‘tool-calls’].message.type === ‘tool-calls’ and perform the desired UI update. No response is sent back to the model.vapi.addMessage(…).Use addMessage to provide extra context mid-call. This does not return results for a tool; it adds messages the model can see.
If you need the model to consume tool outputs (e.g., fetch data and continue reasoning with it), implement a server-based tool. See Custom Tools.
clientMessages: [‘tool-calls’] and handle message.type === ‘tool-calls’.vapi.addMessage to inject data mid-call.