# Tools

> Let your agent take action. Connect apps, choose which tools it can use, and call your own endpoints with webhooks.

Source: https://www.lorito.ai/docs/agent/tools

Beyond answering questions, your agent can **do things**, like look up a calendar, check availability, create a record, or call your own backend. These actions are **tools**, and you manage them from the **Tools** card on the agent page.

There are two ways to give your agent tools: connect a third-party app, or add a webhook to your own endpoint.

## Connecting an app

Lorito connects to many third-party apps through Composio, including calendars, email, and support tools. Connecting one is a one-time setup per project, done in **Customize → Connections**.

1. Open **Customize** and go to the **Connections** tab. Browse the available integrations and pick the one you want.

2. Click to connect. A secure sign-in window opens so you can authorise Lorito to act on your behalf in that app (OAuth). Complete the sign-in and the window closes itself.

3. The connection now shows as **Connected**. It's available to every agent in the project, and you decide per agent whether to actually use it.

A connected app stays connected until you disconnect it from the same screen. Disconnecting stops every agent in the project from using it.

## Choosing which tools the agent may use

A single app can expose many individual tools. You stay in control of which ones your agent is actually allowed to call.

Once an app is connected, it appears in the agent's **Tools** card under **Connections**. Toggle it on to enable it for that agent, then use **Configure tools** to choose its tools:

* **Recommended.** When you first enable an app, Lorito pre-selects a safe set of tools suited to customer-facing use. This is the best starting point for most agents.
* **All tools.** Enable everything the app offers, including any tools added to it in the future. Choose this when you want the agent to have the app's full range.
* **A custom selection.** Pick exactly the tools you want, one by one.

Removing an app from an agent's tools list stops that agent from using it, but leaves the connection in place, so you can re-add it any time. The number of connection tools an agent can use at once is subject to your plan's limit.

> Only enable the tools your agent genuinely needs. A focused set is easier for the agent to use correctly and keeps it from taking actions you didn't intend.

## Webhooks

When you want the agent to call your own service (or an automation platform like Make.com), add a **webhook**. A webhook turns any HTTP endpoint into a tool the agent can invoke.

Click **Add tool → Webhook** in the Tools card and fill in:

* **Tool name.** A friendly name (for example, "Check Availability"). Lorito stores it in a short code form that you can reference in your system prompt.
* **URL.** The endpoint the agent should call.
* **Description.*&#x2A; Tell the agent what the tool does and what data to send. The clearer this is, the better the agent uses it. For example: &#x2A;"Check appointment availability. Send the date and service. Returns available slots."*
* **Await response.** Turn this on if the agent should wait for your endpoint to reply and use that reply in its answer.
* **Secret** (advanced). An optional signing secret for verifying that requests genuinely come from your agent.

Each webhook can be toggled on or off, edited, or removed from the agent at any time. The number of webhooks, and the total number of tools an agent can use, are subject to your plan's limit. If you reach it, disable or remove one to add another.

### What your endpoint receives

Every webhook call is a `POST` request with a JSON body shaped like this:

```json
{
  "tool": "checkAvailability",
  "data": { "date": "2026-06-14", "service": "haircut" },
  "projectId": "9c3f6b2e-4a7d-4e1a-8f2c-1d5b6a9e0c3f",
  "deploymentId": "abc-123"
}
```

* **`tool`** is the tool's short code name, the same one shown under "Stored as" when you add it.
* **`data`** holds the fields the agent filled in, based on your **Description**. This is the only part of the request the agent controls, so validate its shape before trusting it. Lorito doesn't check it for you.
* **`projectId`** is the project the agent belongs to.
* **`deploymentId`** is the channel deployment the conversation is happening on (which website widget, WhatsApp number, and so on), or `null` if the call isn't tied to a specific deployment.

If **Await response** is on, Lorito passes whatever your endpoint returns straight back to the agent as the tool's result. Return whatever your agent's instructions expect it to read (plain text or JSON). If the request times out or your endpoint returns a non-2xx status, the agent sees an error message instead and can tell the visitor its request failed.

### Verifying requests

If you set a **secret**, every request Lorito sends to your endpoint is signed so you can confirm it genuinely came from your agent. Two headers are included:

```
X-Lorito-Signature: sha256=<hmac-sha256-hex>
X-Lorito-Timestamp: <unix-timestamp-seconds>
```

The signature is an HMAC-SHA256, keyed with your secret, over the timestamp and the raw request body joined by a dot (`<timestamp>.<body>`), hex-encoded. To verify a request:

1. Read `X-Lorito-Timestamp` and reject the request if it's more than 5 minutes old. This blocks replays.

2. Recompute the HMAC over `<timestamp>.<raw-body>` using your stored secret. Use the **raw** request body exactly as received. Don't re-serialise the parsed JSON, or the bytes won't match.

3. Compare your result against the value after `sha256=` using a **constant-time** comparison (for example `crypto.timingSafeEqual` in Node), never a plain `===`. Reject the request if they differ.

Here's the check in Node.js:

```ts
import crypto from "node:crypto";

function verify(rawBody: string, headers: Headers, secret: string) {
  const timestamp = headers.get("x-lorito-timestamp") ?? "";
  const signature = (headers.get("x-lorito-signature") ?? "").replace("sha256=", "");

  // Reject stale requests (replay protection).
  const ageSeconds = Math.floor(Date.now() / 1000) - Number(timestamp);
  if (!timestamp || ageSeconds > 300) {
    return false;
  }

  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${timestamp}.${rawBody}`)
    .digest("hex");

  const a = Buffer.from(signature);
  const b = Buffer.from(expected);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
```

> On Make.com you don't need code. Add a filter module at the top of the scenario that recomputes the HMAC with the built-in `sha256` formula and compares it to the header. Your secret stays on your side; Lorito never sends it in the request.
