Client-side Tools
Client-side tools let Myra trigger actions directly in the browser during a live call. Instead of calling a server endpoint, the Vomyra Web SDK fires an event your JavaScript code handles � giving you instant access to your UI, browser APIs, and local state.
How it works
Define the tool
Create a tool with a name, description, and optional parameters. No URL or authentication is needed � there is no server request.
Assistant invokes the tool
During a call, when Myra determines the tool should run, she extracts the required parameters from the conversation and fires the call.
Your handler runs
The Web SDK delivers a tool_call event to your JavaScript handler with the filled-in parameters. You execute any browser logic and return a result.
Conversation continues
Myra receives your result and uses it to continue the conversation � just like a server-side tool response.
Configuration fields
| Field | Required | Description | Example |
|---|---|---|---|
Name | Required | A unique snake_case identifier. The AI uses this as the function name. | show_confirmation |
Description | Required | Tells the AI what the tool does and when to invoke it. The model uses this to decide whether to call the tool. | Show a booking confirmation card to the user |
Parameters | Optional | Dynamic values the AI fills in from the conversation. Each parameter needs a name, type, and description. | booking_id (string), date (string) |
Handling tool calls in the Web SDK
import { VomyraClient } from "@vomyra/web-sdk"
const client = new VomyraClient({ apiKey: "YOUR_API_KEY" })
client.on("tool_call", async ({ tool, parameters, respond }) => {
switch (tool) {
case "show_confirmation":
// Update your UI with the booking details
renderConfirmationCard(parameters.booking_id, parameters.date)
respond({ success: true, message: "Confirmation shown to the user." })
break
case "navigate_to_page":
// Redirect the user
window.location.href = parameters.url
respond({ success: true })
break
default:
respond({ success: false, error: `Unknown tool: ${tool}` })
}
})The respond callback must be called for every tool invocation. Myra waits for your result before continuing the conversation.
Common use cases
Update your UI
Show a booking confirmation, display product details, or reveal a summary card at the right moment in the conversation.
Pre-fill forms
Populate a checkout or registration form with details the caller already provided � so they never have to type what they already said.
Navigate the user
Redirect to a confirmation page, open a new route, or scroll to a relevant section � all triggered by Myra mid-call.
Access browser APIs
Read geolocation, check local storage, or query the DOM � things only the client can do, without any round-trip to a server.
Zero server latency
Client-side tools execute entirely in the browser � there is no HTTP round-trip. They are the right choice whenever you need instant response or access to browser-only APIs like geolocation or local storage.