Build Your OmniagentTools

Overview

What tools are, how the two execution flows work, and how to attach tools to an agent

Tools let your agent do things beyond conversation — trigger workflows, look up data, generate content, or interact with external systems during a session.

Execution flows

Every tool runs in one of two execution flows. The flow determines where the tool call is delivered when the agent invokes it. You choose the flow when you create the tool.

Implicit

The tool call is delivered to the connected client. For WebRTC sessions, this means the Web SDK running in the user's browser; for WebSocket sessions, your WebSocket client. Your client receives the tool call, executes the logic, and returns the result.

Explicit

The tool call is forwarded to a URL you specify when creating the tool — either an HTTP endpoint or a WebSocket endpoint on your server. Use this when the tool needs to reach your backend systems — for example, querying a database, calling an internal API, or triggering an action in a third-party system.

The execution flow is set per tool. You can mix implicit and explicit tools in the same session.

There is a third way to give an agent capability: attach an MCP server. You define nothing and execute nothing — the provider connects to the server, discovers its tools, and runs the calls itself.

Choosing a flow

The tool needs to…Flow
Act on the page or app the user is looking at — update UI, read local stateimplicit
Use data that only exists client-sideimplicit
Reach your backend — a database, an internal API, a third-party systemexplicit
Keep secrets (API keys, credentials) that must never reach the clientexplicit
Stay open for the whole session, receive the live conversation, or push updates backexplicit with a WebSocket endpoint — see WebSocket Tools

Attaching tools to an agent

Tools are attached when you create an Omniagent. Pass an array of tool IDs in the functions field:

{
  "companionId": "companion_abc",
  "voiceId": "alloy",
  "functions": ["fn_abc123", "fn_def456"], 
  "providerSettings": {}
}

You can attach as many tools as you need to a single agent. Tools are reusable — create one once and attach it to as many agents as you like.

Next steps

On this page