## Overview

The Captain does not have to be limited to answering questions from the knowledge base. Two advanced
features turn the assistant into an agent:

- **Scenarios**: guided playbooks, attached to an assistant, that describe a script
  (instructions/steps) to follow in specific situations — for example, qualifying a lead or running a
  collection flow.
- **Custom tools**: HTTP calls the assistant can **invoke** during a conversation to read or write data
  in your systems (look up an order, validate a document, open a ticket).

Together they turn static answers into service that follows processes and fetches information in real
time, while always keeping the option to hand off to a human.

## Prerequisites

- The **Captain** feature enabled on the account and at least **one assistant** already created
  (scenarios and tools attach to it).
- **Administrator** permission to create, edit and delete scenarios and tools.
- **Custom tools** may require an extra flag (`custom_tools` or the Captain `v2` integration). If the
  tools menu does not appear, ask an administrator to enable it.
- For tools that call your systems: the **endpoint URL**, the HTTP method and, when applicable, the
  authentication credentials.

## Step by step

1. Open the **Captain** area and select (or create) the **assistant** that will receive the advanced
  features.
2. **Create a scenario**: provide a **title**, a **description** and the **instruction** (the script/steps
  the assistant should follow). Optionally restrict which **tools** the scenario may use and leave it
  **enabled**.
3. **Create a custom tool**: define **title**, **description**, **endpoint URL**, **HTTP method**, the
  **parameters** the AI must fill in, and the **authentication type**.
4. **Test the tool** with the test button — the platform performs a real request and shows the status and
  a snippet of the response, so you can validate before enabling it.
5. **Enable** the tool and, if you wish, associate it with a specific scenario.
6. Perform **bulk knowledge maintenance** (approve responses, sync/delete documents) and review the
  agents' **copilot** history.
7. Test with real questions in the assistant playground and tune instructions, parameters and scope.

## Settings & options

### Scenarios

Each scenario belongs to an assistant and has:

- **Title** and **description**: identify the scenario and when it applies.
- **Instruction**: the script in natural language — the steps the assistant should follow in that context.
- **Tools**: the list of tools the scenario is allowed to use.
- **Enabled**: turns the scenario on/off; only enabled scenarios are available to the assistant.

Scenarios can be created, edited and deleted at any time without affecting the rest of the knowledge.

### Custom tools

A tool describes an HTTP call the assistant can trigger:

| Field | Purpose |
|---|---|
| **Title / Description** | Name and explanation; the description helps the AI decide **when** to use the tool. |
| **Endpoint URL** | The address that will be called. |
| **HTTP method** | `GET`, `POST`, etc. |
| **Parameters** | Each parameter has `name`, `type`, `description` and whether it is `required` — this is what the AI fills in. |
| **Request / response template** | How to build the body sent and how to interpret the return. |
| **Authentication type and config** | For example, a token/key; credentials are kept protected. |
| **Enabled** | Activates or deactivates the tool for the assistant. |

> The platform may cap the **number** of tools per account; once the limit is reached, creation is
> blocked with a clear message.

### Bulk knowledge

- **Responses (assistant responses)**: bulk actions to **approve** pending responses or **delete** several
  at once, speeding up knowledge curation.
- **Documents (assistant documents)**: bulk actions to **delete** or **re-sync** documents (only documents
  that can be synced are reprocessed).
- **Copilot threads**: the copilot history is per **user** and tied to an assistant. Each query consumes
  the account's Captain **response quota**; when it runs out, the copilot notifies instead of answering.

## Use cases

- **Order lookup via tool**: the customer asks "where is my order?"; the assistant calls a custom tool
  that queries your system and replies with the real status.
- **Guided collection via scenario**: a scenario describes the collection script (greeting, data
  confirmation, sending the payment link) and the assistant follows it step by step.
- **Guided scheduling**: a scenario that drives the booking and uses a tool to check available times.
- **Fast curation**: the team uses bulk actions to approve dozens of responses and re-sync documents after
  a content update.

## Tips, limits & best practices

- **Start with a narrow scope**: a few scenarios and one or two tools; expand as you gain confidence in
  the results.
- **Clear descriptions** on tools and parameters help the AI choose and fill them in correctly.
- **Always test** the tool before enabling, and **review real executions** periodically.
- **Keep the handoff**: always offer a clear path to **talk to a human** when the AI cannot resolve.
- **Scenario vs. tool**: the scenario defines *what to do* (the script); the tool defines *how to fetch or
  record data* (the HTTP call).

## Troubleshooting

- **The tool does not appear**: the custom tools feature may not be enabled for the account (flag). Ask an
  administrator.
- **The scenario does not trigger**: confirm it is **enabled** and attached to the correct assistant, and
  that the instruction clearly describes when to apply it.
- **The tool returned an error**: use the **test** to see the status and response; review URL, method,
  parameters and authentication. Down endpoints or invalid credentials cause failures.
- **I cannot create more tools**: you may have reached the account's tool **limit**.
- **The copilot stopped answering**: the Captain **response quota** may have run out for the period.

## See also

- [Bots and Captain (service AI)](/hc/ajuda/articles/automation-flows-bots-e-captain-en)
- [Flow Builder: visual conversational flows](/hc/ajuda/articles/automation-flows-flow-builder-en)
- [Automation rules: triggers, conditions and actions](/hc/ajuda/articles/automation-flows-regras-de-automacao-en)