Skip to main content
Glama

JSON format / minify / validate

json_format
Read-onlyIdempotent

Format, minify, or validate JSON, optionally sort keys, and get clear line-and-column errors for invalid input; also report size, key count, depth, and value count.

Instructions

Validate, pretty-print (2 or 4 spaces, tab) or minify JSON, optionally sorting object keys (deeply). Invalid JSON gives a clear error with line and column and the lines around it. Also returns size, key count, depth and value count. Give "text" or a file "path"; "output" writes the result to a file. Uses the standard JSON parser (no comments or trailing commas). Web version: https://s3eidat.github.io/json-studio/

Input Schema

NameRequiredDescriptionDefault
modeNo"format" pretty-prints, "minify" removes all whitespace, "validate" only checks (never throws on bad JSON).format
pathNoOr: a path to a JSON file (UTF-8; use this for big inputs).
textNoThe JSON as inline text.
indentNoIndentation: 2, 4, "tab" (or any number of spaces 0-8).2
outputNoOptional: also write the result to this file path (or folder ending in "/"). The result text is then left out of the reply. Results over 1,000,000 characters are always written to a file.
sortKeysNoSort object keys alphabetically at every level.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior1/5

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

The description says the optional "output" parameter writes the result to a file, and that results over 1,000,000 characters are always written to a file. This directly contradicts the readOnlyHint=true annotation, which declares the tool does not modify its environment. Per the rubric, a contradiction with annotations scores 1.

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 front-loaded with the core verbs and remains efficiently structured. The closing web-version URL is not essential for tool selection or invocation, so it is slightly less than perfectly concise.

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?

For a six-parameter tool with no output schema, the description covers the main modes, input methods, output-file behavior, validation error detail, returned metrics, and parser constraints. An agent has enough information to call it correctly, aside from the annotation inconsistency noted separately.

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 all six parameters are already documented in the input schema. The description reinforces input selection via text/path and file output, but adds no parameter semantics beyond what the schema provides. Baseline 3 is appropriate.

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 states specific verbs and resource: validate, pretty-print, minify JSON, with optional deep key sorting. This clearly distinguishes the formatter/minifier/syntax-validator role from conversion or query siblings, even without naming them explicitly.

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 gives clear context for use: pick text or path as input, and output to write results to a file. It also notes the parser limitation around comments and trailing commas. It does not explicitly compare against alternatives such as ai_json_schema_validate or json_query, so it falls short of a 5.

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

Deploy Server

Other Tools