Skip to main content
Glama

Convertir JSON a TOON

toon-encode
Read-onlyIdempotent

Codifica un valor JSON como TOON (Token-Oriented Object Notation, especificación 4.4): sangría en vez de llaves, longitudes declaradas y filas tabulares; suele gastar menos tokens que JSON. Cuándo: hay que transformar, comparar o revisar con exactitud datos estructurados (JSON, CSV, YAML, XML, arreglos). No para: decodificar un texto TOON (toon-decode). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Encodes a JSON value as TOON (Token-Oriented Object Notation, spec 4.4): indentation instead of braces, declared array lengths, tabular rows for uniform objects and minimal quoting, which usually needs fewer LLM tokens than JSON. When: structured data (JSON, CSV, YAML, XML, arrays) has to be transformed, compared or checked exactly. Not for: decoding TOON text (toon-decode). [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
valueYesAny JSON value (any JSON value; required).
indentNoSpaces per indentation level (integer; optional; default 2; min 1; max 8).
delimiterNoDocument delimiter (optional; one of: comma, tab, pipe; default "comma").comma

Output Schema

NameRequiredDescriptionDefault
toonNo
charsNo
json_charsNo
saved_percentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / value / examples
      Added value: +[
      +  {
      +    "tags": [
      +      "a",
      +      "b"
      +    ],
      +    "users": [
      +      {
      +        "id": 1,
      +        "name": "Ada",
      +        "role": "admin"
      +      },
      +      {
      +        "id": 2,
      +        "name": "Bob",
      +        "role": "user"
      +      }
      +    ]
      +  }
      +]
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, closed-world and non-destructive, and the description goes beyond them with operational limits the agent cannot infer elsewhere: 64 KB input cap, 1 s per call, 1 MB result cap, plus an explicit determinism guarantee. These are exactly the constraints that affect caller behaviour and are not encoded in any structured field.

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

Conciseness4/5

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

Front-loaded with the purpose, then the decision rules, then the guards — a well-ordered structure where each sentence carries information. It loses a point because the same content is restated in full in both the description and inputSchema.description, and the Spanish/English parallel text adds bulk without adding semantics.

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

Completeness5/5

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

An output schema exists, so return-value explanation is unnecessary; the description instead covers the things the schema cannot — size/time limits, determinism, absence of side effects and the sibling boundary. For a three-parameter pure function this is fully sufficient to call it correctly.

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 coverage is 100% (each of value, indent and delimiter carries type, default, bounds or enum plus a description), so the schema does the heavy lifting and baseline 3 applies. The description's mention of indentation, declared lengths and minimal quoting gives loose conceptual context for indent and delimiter, but no additional syntax or formatting guidance beyond the schema.

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?

Names a specific verb+resource ('Codifica un valor JSON como TOON') and immediately characterizes the output format (indentation, declared array lengths, tabular rows, minimal quoting) and its benefit (fewer tokens than JSON). It also explicitly distinguishes itself from its closest sibling, toon-decode, so an agent can route without opening either schema.

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?

Provides an explicit 'Cuándo' clause enumerating the applicable input shapes (JSON, CSV, YAML, XML, arrays) and an explicit 'No para' clause pointing at toon-decode. That is the full when/when-not/alternative triad.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources