Skip to main content
Glama

SimplyUtils

Format or minify JSON

format_json
Read-only

Validate JSON and return it pretty-printed or minified, optionally with object keys sorted A-Z (recursively; array order is kept). Returns the formatted JSON as text. Invalid JSON returns an error naming the problem and its position. Input up to 100 KB.

Input Schema

NameRequiredDescriptionDefault
jsonYesThe JSON text to validate and format
indentNo2 or 4 spaces, a tab, or minify to remove all whitespace2
sortKeysNoSort object keys alphabetically at every level

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / indent / description
      Added value: +"2 or 4 spaces, a tab, or minify to remove all whitespace"
    • changedInput schema / properties / json / description
      Previous value: -"The JSON text"New value: +"The JSON text to validate and format"
    • addedInput schema / properties / sortKeys / description
      Added value: +"Sort object keys alphabetically at every level"
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnly/non-destructive annotations it adds real operational context: the 100 KB input ceiling, the fact that output is returned as text, and precise error behavior ('error naming the problem and its position'). It also clarifies the non-obvious recursion semantics of key sorting.

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?

Four tight sentences, front-loaded with the core action and followed by distinguishing behavior, edge cases, and limits. No sentence is filler.

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?

With no output schema, the description correctly explains the return value ('formatted JSON as text') and the error shape, and it covers the size limit. Nothing needed to call this 3-parameter tool correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds meaning the schema doesn't fully carry: the explicit statement that array order is preserved when sorting keys, and that indent choices include pretty-printing vs. minification.

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 names a specific verb and resource ('Validate JSON and return it pretty-printed or minified') and adds the optional key-sorting behavior, making it unmistakable against siblings like base64 or hash_text.

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?

It clearly implies when to reach for this tool (formatting/validating JSON text) and discloses the invalid-input path, but it never names a when-not-to-use condition or an alternative the way a 5 would.

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.