# Tools

[Open in workspace →](/workspace/_/ai/workflows)

Inside a [prompt step](/docs/ai/workflows/steps/#prompt), the AI picks a **tool**. Each tool represents a different action the AI can take, and each tool leads to its own follow-up steps. The AI reads the conversation, considers the context, and chooses the right path forward.

## What a tool looks like

Every tool has four parts:

| Part        | Purpose                                                                                                                                   |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Name        | A short identifier like `answer`, `escalate`, or `request_email`. The AI uses this name when making its choice.                           |
| Description | Tells the AI what this tool does, for example "Answer the user's question" or "Hand the conversation off to a human operator."            |
| Parameters  | The information the AI fills in when it calls the tool. An `answer` tool has a `content` parameter for the response text.                 |
| Use cases   | Instructions that tell the AI _when_ to pick this tool, for example "Call this tool when the user explicitly asks to speak with a human." |

After the AI picks a tool and fills in its parameters, the workflow continues with that tool's **next steps**, typically an action like sending the reply or escalating the conversation.

## How tools connect to the rest of the workflow

Each tool has a list of follow-up steps that run after the AI calls it. Different AI decisions lead to different outcomes:

- The **answer** tool leads to a single reply action that sends the response.
- The **escalate** tool leads to a reply action (telling the customer a human will follow up), then an escalate action (notifying your team), then a workflow action (switching to an "escalated" sub-workflow that keeps the customer comfortable while they wait).

A single prompt step can branch into completely different flows depending on what the AI decides.

## Tool branches

Like [step branches](/docs/ai/workflows/steps/#branch), tool branches show different tools to the AI based on conditions. The AI only sees the tools that match the current situation.

**Example:** A prompt step has an escalation tool with a branch on **User has email**. If the customer has an email, the AI sees an **escalate** tool that hands off directly. If the customer doesn't have an email, the AI sees a **request email** tool that collects the email first. The AI doesn't need to know about this branching. It sees the right tool for the situation.

## Tool refs

A tool ref reuses a tool defined elsewhere in the workflow. This avoids duplicating complex tool configurations that appear in multiple prompt steps.

**Example:** The same escalation tool (with its branching logic for email collection) is used in both the initial answer prompt and the follow-up hypothesize prompt. The second prompt uses a ref that points to the first instead of defining it again.

## Designing good tools

Give each tool a clear, distinct purpose. The AI should never be confused about which tool to pick. "Answer the question" and "Hand off to a human" are clear choices. "Handle the request" is too vague.

Write specific use cases. Instead of "Use when appropriate," say "Call this tool when the user explicitly asks to speak with a human" or "Call this tool when the retrieved sources clearly contain the answer."

Connect tools to meaningful follow-up steps. An answer tool should lead to a reply. An escalate tool should lead to a reply, an escalation event, and a sub-workflow that keeps the customer comfortable while waiting.
