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 asorder-total.lua.
{"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 asnormalize-contact.lua.
{"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 assearch-summary.lua.
{"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.

