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)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses the key behavioral trait: token reduction of 50-70%. However, it doesn't mention error handling, performance characteristics, or limitations (e.g., maximum input size). The description adds value by explaining the transformation logic and benefits, but lacks operational details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured: purpose first, supported formats second, technical explanation third, usage guidance last. Every sentence adds value—no redundancy or fluff. The four sentences each serve distinct functions: what it does, what it supports, how it works, and when to use it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (data transformation with format detection), no annotations, and no output schema, the description does well by explaining the TOON format, benefits, and use case. However, it doesn't describe the output format (what TOON looks like beyond one example) or potential errors, leaving some gaps for an agent invoking it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds context about supported formats ('JSON, CSV, TSV, XML, HTML tables, YAML, and raw objects') which complements the enum in the schema, but doesn't provide additional semantic details about the 'data' parameter beyond what the schema already states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Convert data to TOON (Token-Oriented Object Notation) format to reduce token usage by 50-70%'. It specifies the exact transformation (conversion to header-based format) and distinguishes it from siblings like toon_decode (reverse operation) and toon_analyze/optimize_prompt (different functions).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: 'Use this before sending large datasets to LLMs to save tokens and costs.' It specifies the optimal context (large datasets for LLMs) and implies when not to use it (small data where token savings are negligible). While it doesn't name alternatives, the context makes the primary use case clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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