TOON MCP server reduces tool result tokens by 30-60% in OpenClaw

✍️ OpenClawRadar📅 Published: March 14, 2026🔗 Source
TOON MCP server reduces tool result tokens by 30-60% in OpenClaw
Ad

An MCP server has been released that automatically compresses structured JSON tool results into TOON format, a token-efficient representation designed to reduce token usage by 30-60% for tabular data in OpenClaw sessions.

How it works

TOON is a format designed for token-efficient LLM data representation that uses field names declared once, indentation instead of braces, and no redundant quoting. The MCP server compares token counts between TOON and compact JSON and returns whichever is smaller.

Setup

Add the MCP server to your OpenClaw config (~/.openclaw/openclaw.json):

{
  "mcpServers": {
    "toon": {
      "command": "npx",
      "args": ["@fiialkod/toon-mcp-server"]
    }
  }
}

Add a rule to your AGENTS.md: When any tool returns structured JSON data (arrays of objects, API responses, database results, logs) larger than ~20 fields, pass the result through the toon_format_response tool before reasoning over it.

Ad

Performance

For tabular data (arrays of uniform objects, emails, calendar events, search results, logs, DB rows), TOON typically wins by 30-60%. For small payloads or deeply nested configs, it falls back to JSON compact.

Benchmark with 15 financial transactions and 15 questions:

  • JSON: 14/15 correct (93.3%), ~749 tokens used
  • TOON: 14/15 correct (93.3%), ~398 tokens used

Same accuracy with 47% fewer tokens. The errors were on different questions and neither was caused by the format. TOON was lossless in tests — decode(encode(data)) === data.

Use cases

Best for: Gmail/Calendar MCP results, database queries, API responses, file listings, logs — anything that's an array of objects with repeated keys.

Not needed for: Small payloads (<5 items), deeply nested configs, data you need to pass back as raw JSON.

Problem it solves

System prompt and tool schemas have high fixed costs in OpenClaw, workspace files are semi-fixed, but tool results accumulate fast. When agents read files, query APIs, or browse, this pushes sessions into compaction where context is lost. TOON works upstream by shrinking tool results before they enter the transcript, delaying compaction and keeping more session history intact.

📖 Read the full source: r/openclaw

Ad

👀 See Also

SourceBridge: Open-source tool for codebase analysis using local LLMs
Tools

SourceBridge: Open-source tool for codebase analysis using local LLMs

SourceBridge is an open-source tool that indexes Git repositories into symbol graphs and uses local LLMs to generate codebase summaries, architecture walkthroughs, and learning materials. It supports multiple local backends including Ollama, llama.cpp, vLLM, LM Studio, and SGLang via OpenAI-compatible APIs.

OpenClawRadar
Claude Code Verification Bottleneck and Browser Automation Plugin Solution
Tools

Claude Code Verification Bottleneck and Browser Automation Plugin Solution

A developer reports that verification remains the slowest part of using Claude Code, requiring manual testing of features. They found a browser automation plugin that lets the agent verify real product flows before marking tasks complete.

OpenClawRadar
Open Source Second Brain System Built on Claude Code for Task Management
Tools

Open Source Second Brain System Built on Claude Code for Task Management

An open source system called Kipi System uses Claude Code to track open threads, draft follow-ups, and manage tasks by pulling from calendar, email, CRM, and social feeds. It generates a daily HTML file with pre-written actions sorted by friction.

OpenClawRadar
quorum: AI Code Governance Tool Enforces Independent Model Review
Tools

quorum: AI Code Governance Tool Enforces Independent Model Review

quorum is a governance layer for AI-assisted development that enforces a consensus protocol requiring code to be independently reviewed by a different model before committing. It includes three structural gates that block progress: audit, retro, and quality gates.

OpenClawRadar