# Client-side tools

> Conversational agent tools that run in the user's browser or host application, so the agent can read client data and trigger actions in the host application.

Client-side tools run on the client surface, which is the user's browser or host application, instead of on the UiPath server. When the agent calls a client-side tool, the runtime pauses, sends the tool call to the client, and resumes when the client returns a result.

## When to use client-side tools

Use client-side tools when the agent needs to:

* Read data from the host application that the server can't access, such as the contents of a task board, form fields, or session-specific state.
* Trigger actions in the host application, such as navigating to a page, opening a dialog, creating a record in the local UI, or updating a component.
* Use device or browser features that the server can't access, such as the clipboard, local storage, or geolocation.

:::note
Client-side tools are available only for conversational agents deployed through a surface that supports client-side tool handling, such as the [UiPath TypeScript SDK](conversational-agents-typescript-sdk.md) or any surface that implements the UiPath conversation protocol. The surface must register a handler for each client-side tool, and tools without a registered handler return an error to the agent.
:::

## Configuring client-side tools

To add a client-side tool to your conversational agent:

1. In the agent designer, select **Add tool**.
2. Select the **Client-side tools** category.
3. Fill in the following fields:
   * **Tool name**: a unique name for the tool. The name must begin with a letter or underscore, and can contain only letters, digits, spaces, and underscores.
   * **Description**: what the tool does and when to use it. The agent uses this description to decide when to call the tool.
   * **Input schema**: a JSON Schema object that defines the parameters the agent passes to the client when it calls the tool.
   * **Output schema**: a JSON Schema object that defines the structure of the result the client returns to the agent.

   ![Create client-side tool dialog with the Tool name, Description, Input schema, and Output schema fields](https://dev-assets.cms.uipath.com/assets/images/agents/client-side-tool-definition-ce89c733.png)

4. Select **Create**.

After you create the tool, you can configure more settings in the tool properties panel:

* Edit the tool name, description, and schemas.
* Apply [guardrails](tool-guardrails.md) to enforce runtime policies.
* Enable [tool-call confirmations](#tool-call-confirmations) to require user approval before the tool runs.

### Input and output schemas

Both schemas are required and must be valid JSON Schema objects. They define the contract between the agent and the client:

* The input schema specifies the data that the agent sends to the client when it calls the tool. The agent fills in the input values from the conversation context and the schema definition.
* The output schema specifies the data that the client returns to the agent after it runs the tool. The agent uses this result to continue its reasoning.

#### Example schemas

For a tool that reads tasks from a project board, the input schema is:

```json
{
  "type": "object",
  "properties": {
    "boardId": {
      "type": "string",
      "description": "The ID of the task board to read from"
    },
    "status": {
      "type": "string",
      "enum": ["todo", "in-progress", "done"],
      "description": "Filter tasks by status"
    }
  },
  "required": ["boardId"]
}
```

The output schema is:

```json
{
  "type": "object",
  "properties": {
    "tasks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "status": { "type": "string" },
          "assignee": { "type": "string" }
        }
      }
    }
  }
}
```

### Behavior on pre-built surfaces

On pre-built surfaces, such as [Instance Management](conversational-agents-instance-management.md) and [iFrame embedding](conversational-agents-apps-embedding.md), a client-side tool displays a form to the user based on the output schema. The user fills in the fields and submits the result back to the agent.

On custom surfaces built with the [UiPath TypeScript SDK](conversational-agents-typescript-sdk.md), the host application handles tool calls programmatically. It reads data, triggers actions, or interacts with local systems without manual user input.

## How client-side tools work at runtime

When the agent calls a client-side tool during a conversation:

1. The agent decides to use the tool based on the conversation context and the tool description.
2. If [tool-call confirmations](#tool-call-confirmations) are enabled, the user reviews and approves the proposed input before the tool proceeds.
3. The runtime sends the tool call to the client surface, including the tool name, the input values, and the input and output schemas.
4. The client surface runs its registered handler for the tool with the provided input.
5. The client returns the result to the runtime.
6. The agent receives the result and continues its reasoning.

## Tool-call confirmations

You can require user confirmation before a client-side tool runs. Use confirmations for tools that perform actions with visible side effects, such as creating a task, updating a record, or navigating away from the current page.

To require confirmation for a client-side tool:

1. Select the client-side tool in the agent designer.
2. In the tool properties, enable **Require confirmation**.

When confirmation is enabled, the agent pauses before it runs the tool and shows the user the proposed input parameters. The user can approve the tool call, modify the inputs, or reject the tool call. For details, refer to [Tool-call confirmations](conversational-agents-design.md#tool-call-confirmations).

## Example: project planning assistant

A project planning assistant is embedded in a task management application. The agent has two client-side tools:

* `read_board_tasks`: reads the current tasks from the user's task board in the host application.
* `create_task`: creates a new task on the user's board.

When a user asks "What should I work on next?", the agent calls `read_board_tasks` to read data from the client. The host application reads the board state and returns the task data. The agent then analyzes the tasks and suggests a priority order based on status, deadlines, and dependencies.

When the user asks "Add a task to review the Q3 report by Friday", the agent calls `create_task` to write data to the client, with the title, description, and due date. If confirmation is enabled, the user reviews the proposed task details first. The host application creates the task on the board, and the agent confirms that the task was created.

## Limitations

* Client-side tool execution depends on the availability and responsiveness of the client surface. If the client disconnects while the tool runs, the tool call can fail.
* The client surface must register a handler for each client-side tool that the agent defines. If a handler is missing, the tool call returns an error to the agent.
