Skip to main content
Glama

Benchline

Format and validate JSON

format_json
Read-onlyIdempotent

Pretty-print or minify JSON. A number that does not fit in a JavaScript number keeps the digits you sent. Returns the formatted text when it is valid, or the line and column of each syntax error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonYesJSON text to format or validate.
indentNo2
minifyNo
sortKeysNoSort object keys. Array order is kept.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYes
errorsYes
outputYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-open-world, so safety is covered. The description adds genuinely useful behavior beyond that: big integers keep their original digits (a real precision guarantee), and invalid input returns line/column per syntax error, which tells the agent exactly how failures surface.

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?

Three tight sentences, zero filler, and the primary action is front-loaded in sentence one. Each remaining sentence adds a distinct fact (number precision, success/failure return shape) rather than padding.

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?

An output schema exists, so the description needn't detail return values, and the annotations carry the safety profile. What it adds (precision guarantee, error positions) makes the tool usable, though it omits which sibling to choose for schema validation versus raw formatting.

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 only 50%: 'json' and 'sortKeys' are documented, while 'indent' (enum with no description) and 'minify' (boolean with no description) are not. The description partially compensates by contrasting pretty-print with minify and clarifying that the input's numeric digits are preserved, but it says nothing about indent values or key-sorting behavior.

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

Purpose4/5

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

The description states a specific verb pair (pretty-print/minify) and resource (JSON), which is distinct from most siblings. However, it never names close alternatives like minify_code or validate_json_schema, and the added 'or validate' framing overlaps with validate_json_schema's territory, so the agent gets no explicit sibling differentiation.

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

Usage Guidelines3/5

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

Usage is implied by the action ('pretty-print or minify JSON') and by noting that invalid input yields error positions, so an agent can infer this is the tool for formatting/validating raw JSON text. There is no explicit when-to-use versus alternatives such as validate_json_schema, convert_json_to_types, or minify_code.

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