> ## Documentation Index
> Fetch the complete documentation index at: https://docs.connectly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools Overview

> Build, test and monitor the actions your AI agents, campaigns and WhatsApp Flows can run.

A **tool** is a reusable action that Connectly can run for you, such as looking up an order, checking stock, creating a ticket or saving a record. You build it once on the **Tools** page and then use it from your AI agents, campaigns and dynamic [WhatsApp Flows](/campaigns/whatsapp-flow-builder).

<CardGroup cols={2}>
  <Card title="Look up data" icon="magnifying-glass">
    Fetch a customer, order or booking from your own system.
  </Card>

  <Card title="Take an action" icon="bolt">
    Create a ticket, update a CRM record or send data to a webhook.
  </Card>

  <Card title="Reshape data" icon="wand-magic-sparkles">
    Clean up or combine data with a few lines of JavaScript.
  </Card>

  <Card title="Remember things" icon="database">
    Store small bits of data between runs in the built-in datastore.
  </Card>
</CardGroup>

## The Tools page

Open **Tools** in the sidebar. The page has four tabs:

| Tab | What it shows |
| - | - |
| **Tools** | Every tool in your business, with its status, success rate and the campaigns that use it. |
| **Executions** | A live log of every time a tool ran, with its result and timing. |
| **Shared Tools** | Tools another business has shared with you (read-only). |
| **Integrations** | Your connected integrations. |

The **Tools** tab lists each tool with these columns:

| Column | Meaning |
| - | - |
| **Tool** | Name and description. |
| **Status** | `Draft` or `Published`. |
| **Activity** | Recent success rate, for example `98% success`. It shows `No runs yet` for a new tool, or `Limited data` when there are only a few runs. |
| **Campaigns** | How many campaigns use the tool. Hover to see their names. |
| **Created by / Updated** | Who made the tool and when it last changed. |

Use the search box to find a tool by name or description. You can also filter by type or by campaign.

## Create a tool

<Steps>
  <Step title="Click Create Tool">
    On the **Tools** tab, select **Create Tool**.
  </Step>

  <Step title="Name and describe it">
    Give the tool a **Name** (letters, numbers, underscores and hyphens only, no spaces), for example `get_customer_info`.

    Then write a **Description** that says what the tool does and **when the AI should use it**. AI agents read this text to decide whether to call your tool, so a clear description matters.
  </Step>

  <Step title="Choose a type">
    Pick **API Call** or **JavaScript Script** (see below).
  </Step>

  <Step title="Configure, test and publish">
    Set up the tool, run a test, then publish it.
  </Step>
</Steps>

### Which type should I use?

| | API Call | JavaScript Script |
| - | - | - |
| **Best for** | Simple calls to an external service | Custom logic, several steps, or reshaping data |
| **You configure** | Method, URL, headers and authentication | Code in the built-in editor |
| **Testing** | Run a test with sample input | Run a test with sample input and see logs |

<Tip>
  Start with **API Call** for simple integrations. Use **JavaScript Script**
  when you need conditions, loops, several requests in one tool, or custom
  formatting.
</Tip>

### API Call tools

An API tool sends an HTTP request to a service when it runs.

* **Method** and **Endpoint URL**: choose the HTTP method and enter the URL. Use `{parameter}` for values that change on each call, for example `https://api.example.com/orders/{order_id}`.
* **Headers**: add any headers the service needs.
* **Authentication**: choose a saved credential, or select **New Resource** to create one (see [Authentication](#authentication)).

### JavaScript Script tools

A script tool runs your JavaScript each time it is called. It receives the tool's input, does its work and returns a result. The editor has real-time testing, so you can run it and see its output and logs before you publish.

If your script imports another tool, the editor warns you when it uses an **older version**. Update the import, then deploy and test again to use the newer version.

### Input and output schema

Open the **Schema** tab to describe your tool using JSON Schema:

* **Input JSON Schema**: the information the tool expects, for example an `order_id` string.
* **Output JSON Schema**: the shape of what it returns.
* **Sample Result**: an example of a typical result.

A good schema helps AI agents fill in the right values and understand the result.

## Authentication

API tools can authenticate with your service. Credentials are **encrypted and stored securely**. They are never shown again in plain text after you save them.

| Type | Use when |
| - | - |
| **No Authentication** | The API is public. |
| **Custom Headers / API Key** | The service expects a key in a header, for example `Authorization` or `X-API-Key`. |
| **Query Parameters** | The service expects a key in the URL, for example `?api_key=...`. |
| **OAuth 2.0 Client Credentials** | The service issues tokens from a Token URL using a Client ID and Client Secret. |
| **Client Certificate (mutual TLS)** | The service requires a client certificate. Provide the full certificate chain and the private key, both in PEM format. |

<Note>
  For mutual TLS, the private key must **not** be passphrase-protected. Export
  it without a passphrase and try again if you see an error.
</Note>

Saved credentials appear in the **Select authentication resource** list, so you can reuse them across tools.

## Test your tool

Use the **Test** panel next to the editor.

1. In **Mock Input**, enter the JSON the tool should receive, for example `{ "order_id": "12345" }`.
2. Select **Run Test**.
3. Check the **Output** tab for the result and the **Logs** tab for details. The status shows `SUCCESS` or `ERROR`.

<Warning>
  Tests run against the **last saved version**, not the text on screen. If you
  have unsaved changes, Connectly warns you and offers **Deploy & Test**
  (scripts) or **Save & Test** (API tools), which saves a new version first.
  Choose **Test Saved Version** to test the previous version instead.
</Warning>

## Versions, drafts and publishing

Every save creates a new **version** of your tool, so you can see what changed and go back.

* Use the **version selector** at the top of the editor to switch between versions.
* When you save or deploy, choose **Auto-increment** (Connectly picks the next number) or **Custom version** (for example `2.0.0`). A custom version must be higher than the current one.
* A tool starts as a **Draft**. Select **Publish** to make it available. You need to save or deploy your latest changes before you can publish.

The editor also shows who created the tool and who last edited each version, which is useful when several teammates work on the same tool. AI-assisted edits are labelled **AI Assistant**.

## Monitor your tools

### Executions

The **Executions** tab lists every run, newest first, and updates as new runs arrive. For each run you can see the time, tool, status, duration and status code. Select a run to open its logs, including the execution, session and room it belongs to.

Narrow the list with filters:

* **Tool**: pick one tool, or search by name (use `|` to search for several).
* **Status**: `Success` or `Failed`.
* **Time range**: from 15 minutes up to 15 days, or a custom range.
* **Execution ID, Session ID or Room ID**: jump straight to one conversation or run.

<Tip>
  When a customer reports something odd in a conversation, filter by **Room ID**
  to see exactly which tools ran and what they returned.
</Tip>

### Success rate

The **Activity** column on the Tools tab shows how healthy each tool is at a glance. A drop in success rate is usually the first sign that an external service is down or a credential has expired.

### Datastore

The **Datastore** is durable key/value storage that your tools can read and write while they run, for example to remember a customer's last choice.

* Browse and filter keys by prefix, and see each key's value, size and last update.
* Add, edit or remove keys. Changes take effect immediately.
* Roll back to an earlier point. You can restore any moment within the rewind window shown on the page. Connectly saves a restore point of the current state first, so a rollback can itself be undone.

<Warning>
  Rolling back discards **everything written after the chosen moment**,
  including data your tools wrote since then.
</Warning>

## Share a tool

You can share a tool with another business.

1. Open the tool's **Share** action from the Tools list.
2. Enter the other business's ID and select **Share**.
3. To stop sharing, select **Unshare** next to that business.

The other business sees the tool under **Shared Tools**. They can view and test it, but cannot edit it. Shared runs are marked **Shared** in Executions.

## Delete a tool

Select **Delete** on the tool's row. This removes the tool **and all its versions**, and it cannot be undone.

<Warning>
  If campaigns use the tool, the confirmation lists them (for example, "3
  campaigns use this tool. Their tool steps will stop working"). Update those
  campaigns first.
</Warning>

Tools that power a WhatsApp Flow are managed with the flow. They are deleted automatically when the flow is deleted or deprecated. See [WhatsApp Flow builder](/campaigns/whatsapp-flow-builder).

## Troubleshooting

| Symptom | What to check |
| - | - |
| Tool won't publish | Save or deploy your latest changes first, wait for the version to finish loading, and make sure a description is filled in. |
| Test result doesn't match my changes | The test ran the last saved version. Use **Deploy & Test** or **Save & Test**. |
| Name is rejected | Use only letters, numbers, underscores and hyphens. |
| Many `Failed` runs | Open **Executions**, filter by **Failed**, and read the logs. Look for expired credentials or an unreachable URL. |
| Certificate error on a client-certificate credential | Check the chain and key are both PEM, and the key has no passphrase. |
| AI agent never calls my tool | Rewrite the description to say clearly when it should be used, and add an input schema. |

## Next steps

<CardGroup cols={2}>
  <Card title="WhatsApp Flow builder" icon="whatsapp" href="/campaigns/whatsapp-flow-builder">
    Build forms inside WhatsApp, and connect them to a tool.
  </Card>

  <Card title="WhatsApp Flows API" icon="code" href="/messaging/whatsapp-flows">
    Send a flow from your own system.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.