Skip to main content
These examples use the Atonom sandbox helpers and the stored-script transform(context) contract. Copy each example into a file in your own working folder using the filename shown below. The test commands require sandbox access.

Calculate an order total

Save as order-total.lua.
Expected value: {"qty":2,"total":25}. Missing fields, negative numbers, and fractional quantities fail validation. Choose an explicit rounding policy before using this pattern for money.

Normalize a contact and preserve JSON shape

Save as normalize-contact.lua.
Expected value: {"email":"ada@example.com","tags":[],"manager":null}. This example trims and lowercases an email string; it is not a complete email-address validator. The manager field deliberately returns null.

Summarize a mocked search result

Save as search-summary.lua.
Expected value: {"ok":true,"count":2}. web_search is an illustrative capability name. Configure the actual available capability and its result contract before using this pattern on the platform. See Test & mock tool calls for host-failure cases and envelope handling.

Turn a recipe into a stored tool

Create a tool or pull an existing one, then copy the example’s body into the linked local file. Configure the corresponding input schema in the Atonom tool editor. Use the first-tool walkthrough to review, sync, test, and enable it.