To TOON
Converts JSON to Token-Oriented Object Notation (TOON). TOON is a compact, human-readable
serialization of JSON designed for LLM prompts. To TOON lives in the Data format category of the fx menu. See the
TOON specification for format details.
Parameters
Section titled “Parameters”Studio shows these descriptions on each parameter. Options map to the library’s non-deprecated delimiter and
indentSize encode settings (deprecated indent and encode replacer callbacks are not exposed).
Returned value
Section titled “Returned value”Limitations
Section titled “Limitations”- Input must be valid JSON (or an already structured value, including JSON
null). Empty or missing Input raises an evaluation error; invalid JSON also raises an evaluation error. - Delimiter must be one of
Comma,Tab, orPipe. - Encoding follows the official
@toon-format/toonrules for tabular arrays and quoting.
Examples
Section titled “Examples”Encode a JSON object as TOON
Turn a small JSON object into a compact TOON string you can pass to an LLM prompt or store for later decoding with From TOON.
-
Set Input to a JSON object. Paste:
Input {"ok":true} -
Leave Delimiter as
Commaand Indent size as2. -
Confirm Output value is:
Output ok: true
Encode a tabular array with a pipe delimiter
Use a pipe delimiter when commas appear in field values or when a downstream model expects | separators.
-
Set Input to:
Input {"users":[{"id":1,"name":"Ada"},{"id":2,"name":"Bob"}]} -
Set Delimiter to
Pipe. -
Confirm Output value is:
Output users[2|]{id|name}:1|Ada2|Bob