Class OrderStatusTool

All Implemented Interfaces:
GuardedExecution, Identifiable, Job<OrderStatus>, Tool<OrderNumber, OrderStatus>

public class OrderStatusTool extends AbstractTool<OrderNumber, OrderStatus>
A model on its own can only read and write text; for everything else it needs tools, pieces of your code it may ask to have run. This is one: it looks an order up, and a model calling it never touches the data itself - it says "run order_status with this number", Nucleo runs this code, and the model reads what came back.

A model chooses a tool the way a person chooses a button: by reading its label. @ToolName is the name it calls the tool by and @ToolDescription says what the tool is for; readOnly = true promises the tool changes nothing, which lets it be offered to agents that are only allowed to look. The input and output are plain beans: from OrderNumber Nucleo builds the form a model fills in, and an OrderStatus goes back to code as the object and to a model as text.

getRequirements() is where a tool asks for what it needs while it runs - a connection, a transaction - and Nucleo hands them over when the tool starts and takes them back when it ends. This one needs nothing.

The two failures are typed, and that is how the model knows what to do next: InvalidInputException means the caller asked the wrong way and says how to ask right, so a model corrects its call and tries again; ResourceNotFoundException means the order does not exist.

Since:
0.1 (2026-09-27)
Author:
Andrey Santrosyan