Skip to main content
Glama

toon_encode

Convert JSON, CSV, XML, and other structured data into TOON format to reduce LLM token usage by 50-70% and lower costs.

Instructions

Convert data to TOON (Token-Oriented Object Notation) format to reduce token usage by 50-70%.

Supports: JSON, CSV, TSV, XML, HTML tables, YAML, and raw objects.

TOON uses a header-based format where field names are defined once:

  • JSON: {"id":1,"name":"test"} → [id,name]\n1,test

  • Reduces repetitive keys in arrays of objects

Use this before sending large datasets to LLMs to save tokens and costs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe data to encode (JSON, CSV, XML, YAML, or other supported format)
formatNoInput format (default: auto-detect)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/elminson/toon-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server