Skip to main content

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.

Token Optimization settings panel showing Tool Output Format options and Playground action

Configure the output format

  1. Open Admin > Settings.
  2. Find Token Optimization.
  3. Set Tool Output Format.
  4. Use Playground to test formats before changing production behavior.
  5. Select Save Changes.

Format changes apply to subsequent tool calls. Existing log entries and previous tool outputs are not rewritten.

Format options

FormatUse when
DefaultRecommended starting point. Willow keeps the tool's native output, usually compact JSON.
JSON CompactYou need guaranteed JSON structure with minimal whitespace.
JSON PrettyYou are debugging and want readable JSON. It usually uses more tokens.
CSVTool output is an array of objects with consistent fields.
YAMLYou want more human-readable output and can accept token usage similar to pretty JSON.
TOONOutput 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.

Token Optimization settings with the Tool Output Format dropdown open showing Default, JSON Compact, JSON Pretty, CSV, YAML, and TOON

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.

Token Optimization Playground showing Real Data testing with recent tool responses

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.

Token Optimization Playground showing Custom Test input and Test All Formats action

Choosing a format

SituationRecommended starting point
Mixed or unknown output shapesDefault
APIs that always return JSON objectsJSON Compact
Large lists of similar recordsCSV or TOON
Debugging a tool responseJSON Pretty, then switch back after debugging
Human-readable intermediate outputYAML

If conversion fails, Willow should continue returning the original tool output rather than blocking the tool call.