Agent Script Reference: Tools (Reasoning Actions)

Tools are executable functions that the LLM can choose to call, based on the tool's description and the current context. You define tools in the topic's reasoning.actions block. Tools can be actions or other utilities.

Tools must wrap an action or a @utils function. Use with to bind parameters and set to assign output values to variables. You can use the available when parameter to deterministically specify when the tool is available.

The following example illustrates a few more ways to use available when to define the conditions that must exist for the LLM to use the tool.

In reasoning actions, you can reference a topic directly with @topic.<topic_name> or through a declarative transition (@utils.transition to). Use a direct @topic.<topic_name> reference to delegate to a topic, similar to an action or tool call. After the referenced topic is run, the flow returns to the original topic. This behavior is different from a declarative transition (@utils.transition to) in that transitions are one way, whereas a direct topic reference returns to the original caller. If a referenced topic includes a declarative transition, the flow follows that path until it ends, and then returns to the original topic.

In this code sample, you can see both methods of calling another topic.