Skip to main content
Glama

Compare JSON, TOON and Compact sizes

demo_compare_formats
Read-onlyIdempotent

Compare JSON, TOON, and Compact encodings of a JSON payload by returning character counts, estimated token counts, and percentage saved versus the JSON baseline.

Instructions

Encodes one JSON document as JSON, TOON and Compact renderings and returns each form's character count, estimated token count and percentage saved against the JSON baseline — the way to measure mcptoon's output compression on a payload you actually have. ...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payloadYesA complete JSON document (object, array, string, number, boolean or null) serialised as text; must parse as JSON and is read as data, never executed.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatsYesOne entry per rendering: json, toon and compact.
slim_noteYesWhy the SLIM format is absent from this comparison.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.14

TDQS

A4.1/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so the safety and idempotence profile is already clear. The description adds that the payload 'is read as data, never executed' in the schema, but the description itself does not repeat that; it does clarify the output structure (character count, estimated token count, percentage saved) which is behavioral context not in annotations. However, it does not mention rate limits, execution time, or potential errors, so a 4 is appropriate for adding useful output context.

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?

The description is a single, front-loaded sentence that efficiently conveys the purpose, output, and use case. The trailing ellipsis is odd but does not detract from conciseness. It earns its place without waste.

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?

With one fully documented parameter, rich annotations, and an output schema present, the description needn't explain return values. It adequately completes the picture by stating what is returned and why, though it could explicitly differentiate from siblings like demo_encode_toon. Given the output schema exists, this is nearly complete.

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 parameter 'payload' is fully documented in the schema as a JSON document serialized as text. The description adds no additional parameter syntax or constraints beyond what the schema provides, so the baseline of 3 applies.

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?

States a specific verb (encodes), resource (one JSON document), and the exact scope: comparing JSON, TOON, and Compact renderings with character counts, token estimates, and percentage saved. This clearly distinguishes it from siblings like demo_encode_toon or demo_estimate_tokens, which do single-format work, by framing the tool as a comparison against a JSON baseline.

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

Usage Guidelines4/5

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

The description implies usage: 'the way to measure mcptoon's output compression on a payload you actually have.' It does not explicitly state when NOT to use it or name alternatives (e.g., use demo_encode_toon for just TOON output or demo_estimate_tokens for a single token count), so it falls short of a 5 but provides clear context for the payloaud-in-hand use case.

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