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

# Prompting tool use

> `instructions` text for tool use: confirming before an irreversible action, keeping tool names out of replies, handling a tool error, and deciding when to search.

A tool's `description` and `parameters` tell Dialog-RSN-1 what the tool does and what it needs. Your `instructions` tell it when a call is worth making, what to confirm first, and how to talk about the result. Dialog-RSN-1 calls one tool at a time and ends its turn with a reply to the caller. When a tool looks like it will take a while, it says a short line to the caller as it calls it.

For the wire side of the loop, and for control over what a tool says, see [Tools and knowledge](https://docs.poly.ai/dialog-rsn-1/tools-and-knowledge.md).

## Confirming before an irreversible action

Name the tools that need a spoken yes first. A tool definition carries a name, a description and a parameter schema but no risk level, so `instructions` has to say which tools cancel, charge or change something.

```text instructions: confirm before a destructive tool call theme={"theme":{"light":"github-light","dark":"github-dark"}}
Before calling cancel_booking or issue_refund, read back what you are about
to do in plain terms and wait for the caller to confirm, for example "just
to confirm, I'll cancel your booking for Tuesday, is that right?" Don't call
either tool until they say yes. Tools that only look something up, like
get_booking or get_account_balance, don't need confirmation first.
```

## Speaking about results, not tools

Ask for tool names and arguments to stay out of what the caller hears. The model then talks about what it found.

```text instructions: keep tool names out of replies theme={"theme":{"light":"github-light","dark":"github-dark"}}
Never mention a tool's name, its arguments, or the fact that you called a
function. Speak only about what the result means for the caller. For
example, after calling get_weather, say "it's 68 degrees and partly cloudy
in Tokyo," not "I called get_weather and got a result."
```

## Handling a tool error

Describe what an error looks like in your tool results. A `function_call_output` is a string you write, and nothing in the protocol marks it as a failure, so an account not found or a payment declined looks like any other result unless `instructions` says otherwise. Match the prompt to the shape your own tools return.

```text instructions: recognize and recover from a tool error theme={"theme":{"light":"github-light","dark":"github-dark"}}
Tool results are JSON. If a result includes an "error" field, the call
failed. Don't treat the rest of the object as real data. Tell the caller
what went wrong in plain language and offer a next step, for example "I'm
not able to look up that account right now, would you like me to transfer
you to someone who can?" Don't retry the same tool call more than once with
the same arguments.
```

## Deciding when to search

Say when to search instead of answering from memory, and what to do when nothing relevant comes back. The search tool and how its results reach the model are on [Tools and knowledge](https://docs.poly.ai/dialog-rsn-1/tools-and-knowledge.md#searching-and-getting-citations-back). This is the `instructions` text on top of it.

```text instructions: when to search, and what to do with nothing theme={"theme":{"light":"github-light","dark":"github-dark"}}
Before answering a question about policy, pricing, or account rules, call
search_knowledge_base rather than answering from memory. If the search
returns nothing relevant, say you're not sure and offer to connect the
caller with someone who can help, rather than guessing.
```

## Next steps

> [card] [Tools and knowledge](https://docs.poly.ai/dialog-rsn-1/tools-and-knowledge.md)
>
> The tool loop, speech while a tool runs, and search results with citations.

> [card] [Reference](https://docs.poly.ai/api-reference/dialog-rsn-1/reference.md)
>
> Every tool field, event and error code.
