Output Format Optimization
Output Format Optimization controls how Willow formats tool outputs before they are sent to the model. It is configured from Admin > Settings under Token Optimization.
Use this setting when tool responses are a major source of token usage. It works alongside Token Usage Analytics: analytics shows where output tokens are coming from, and output-format optimization changes how structured tool output is represented.

Configure the output format
- Open Admin > Settings.
- Find Token Optimization.
- Set Tool Output Format.
- Use Playground to test formats before changing production behavior.
- Select Save Changes.
Format changes apply to subsequent tool calls. Existing log entries and previous tool outputs are not rewritten.
Format options
| Format | Use when |
|---|---|
| Default | Recommended starting point. Willow keeps the tool's native output, usually compact JSON. |
| JSON Compact | You need guaranteed JSON structure with minimal whitespace. |
| JSON Pretty | You are debugging and want readable JSON. It usually uses more tokens. |
| CSV | Tool output is an array of objects with consistent fields. |
| YAML | You want more human-readable output and can accept token usage similar to pretty JSON. |
| TOON | Output is tabular and you want a compact table-oriented representation. |
Do not switch formats only because one looks shorter in a synthetic example. Test with real tool responses whenever possible.

Playground
The Playground opens as a side panel with two tabs.
Real Data
Real Data tests formats against recent tool responses. Use this first because it reflects your organization's actual MCP usage. You can filter by MCP server before testing.

Custom Test
Custom Test lets you paste text, JSON, or representative tool output and run Test All Formats. Use it when you are evaluating a new tool or do not yet have enough recorded responses.

Choosing a format
| Situation | Recommended starting point |
|---|---|
| Mixed or unknown output shapes | Default |
| APIs that always return JSON objects | JSON Compact |
| Large lists of similar records | CSV or TOON |
| Debugging a tool response | JSON Pretty, then switch back after debugging |
| Human-readable intermediate output | YAML |
If conversion fails, Willow should continue returning the original tool output rather than blocking the tool call.