1 minute readNewAgent-ready
Rule based functions price by the rule you write
Give a rule_based function its rule, such as "cheapest competitor less 2%, never below cost, ending in .99", and it prices exactly by that rule.
A rule_based function now carries its own rule: where the price starts (the current price, your unit cost, competitor prices or any field you send), then steps applied in order.
- Steps: adjust by a percentage, add a margin, scale by an index such as demand, volume tiers, floors and ceilings that hold through every later step, a price ending such as .99, and rounding.
- The schema matches the rule: the function's input schema is made from its rule, and a call missing an input the rule needs is refused naming it.
- Explained step by step: the explanation lists each step and the price after it.
- Ready before it is live: a
rule_basedfunction needs a rule before it can be active (rule_required), and routing never picks one without a rule. - Versions: changing the rule, endpoint, schemas or cost raises the function's
version, andcreate_functioncan make a function active at once withstatus: active. - MCP:
create_functionandupdate_functiontakerule.