# From TOON

Converts [Token-Oriented Object Notation (TOON)](https://toonformat.dev) to JSON. TOON is a compact, human-readable
serialization of JSON designed for LLM prompts. From TOON lives in the **Data format** category of the `fx` menu. See
the [TOON specification](https://github.com/toon-format/spec) for format details.

## Parameters

| Parameter   | Type    | Required | Default | Description                                                                                                                                                                         |
| ----------- | ------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Input       | string  | yes      | —       | TOON text to decode into JSON. Must be a string (previous-step TOON output or a literal). Empty Input is rejected.                                                                  |
| Indent size | number  | no       | `2`     | Spaces per indentation level expected in the TOON input. Must match the indent used when the document was encoded (default `2`, same as `@toon-format/toon` decode).                |
| Strict      | boolean | no       | `true`  | When true (default), enforce declared array lengths and tabular row counts and reject mismatches. Set false only to accept non-conforming TOON the library can still parse loosely. |

Studio shows these descriptions on each parameter. Options map to the library’s non-deprecated `indentSize` and
`strict` decode settings (deprecated `indent` is not exposed).

## Returned value

| Type   | Description                                      |
| ------ | ------------------------------------------------ |
| `JSON` | JSON string produced by decoding the TOON input. |

## Limitations

- Empty Input raises an evaluation error.
- Invalid TOON (or length mismatches when **Strict** is enabled) raises an evaluation error — fix the Input or disable
  **Strict** only when you intentionally accept non-conforming documents.
- Decoding follows the official [`@toon-format/toon`](https://www.npmjs.com/package/@toon-format/toon) decoder.

## Example

<details>
<summary>Decode TOON to JSON</summary>

Convert TOON text (for example the output of **To TOON**) back into a JSON string for downstream steps.

1. Set **Input** to:

   ```text title="Input"
   ok: true
   ```

2. Leave **Strict** enabled.

3. Confirm **Output value** is:

   ```text title="Output"
   {"ok":true}
   ```

</details>
