Built-in tools
builtin__sort
Sorts a list by a field, with no model call.
Behavior
byis the field, as a dot path such asscoreormeta.date. Withoutby, the items themselves are compared.orderisasc(the default) ordesc.- Numbers compare as numbers and strings as text, so ISO dates sort correctly. The sort is stable.
- Items missing the field go last in either order.
When to use it
- Ordering by a value the items already carry: a date, a count, a score from an earlier step.
- To order items by how well they fit a question, use
builtin__rank.
| Available to | Effect |
|---|---|
| Any agent or plan step | Read-only |
Input
bystring
Dot path into each item to sort on, e.g. url or meta.date
The list, usually a template like {{E1.results}}
orderenum<string>
Default asc
Available options: asc, desc
Output
- id: E1
tool_name: builtin__sort
input:
items: "{{input.items}}"