Skip to main content
Web tools are JavaScript functions that run in the user’s browser, allowing your agent to interact directly with your web application. They are registered via the Voice Agents SDK and triggered by the agent during conversation.
Web tools only work when the agent is deployed via the Hamsa Voice Agents SDK. They do not function on phone calls.

What Web Tools Can Do

Since web tools run as JavaScript in the browser, they can do anything your web application can:
  • Navigate the user — take them to a specific page (e.g., “Show me the backpacks” → navigate to /products/backpacks)
  • Open UI elements — show a modal, expand a panel, trigger a popup
  • Interact with the page — scroll to a section, highlight an element, fill a form
  • Read page data — get the current URL, check cart contents, read form values
  • Call client-side APIs — access local storage, query IndexedDB, use browser APIs

How They Work

Registering Web Tools

Web tools are registered as JavaScript functions when starting a conversation via the SDK:

Return Values

Web tools can return:
  • A string — simple confirmation sent back to the agent
  • A JSON object — structured data the agent (or flow) can use

Behavior in Single Prompt vs Flow Agents

Single Prompt Agents

  • The agent decides when to call the tool based on conversation context
  • The return value (string or JSON) is sent back to the LLM as-is
  • The model uses it as context for its next response
  • No structured extraction — the model interprets the response naturally

Flow Agents

  • Web tools are used via Web Tool Nodes
  • You can extract specific values from JSON responses using output mapping
  • The extracted values can be used in transitions to route the conversation
  • You can configure a processing message the agent speaks while the tool runs

Examples

Website Navigation

Opening a Modal

Reading Cart Data

Form Submission

Versioning

Like server-side tools, web tools are tracked via persistent IDs. When you register a tool in your SDK code, use the Persistent ID provided in the dashboard if you want to link it to a dashboard-managed tool record. This ensures that any call logs or analytics in the dashboard are correctly associated with the specific web tool.

Tools Overview

Overview of all tool types

Web Tool Node (Flow Agent)

Using web tools in flow agent nodes

Voice Agents Web SDK

Full SDK reference including tool registration

Function Tools

Server-side API call tools