Skip to main content
Glama

JSON prettify / minify

json_format
Read-onlyIdempotent

Validate JSON and format it by pretty-printing or minifying, with optional key sorting to clean up and standardize data.

Instructions

Validate JSON and pretty-print or minify it, optionally sorting keys. (Same as IT-Tools /json-prettify.)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "json": "<json>"
    },
    "name": "json_format"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsonYes
indentNo0 minifies
sortKeysNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so the safety profile needs no restating. The description does add two behavioral facts beyond the annotations: it validates (implying a failure mode for malformed input) and key sorting is optional. It stops short of saying what a failure returns or what the output looks like (formatted string vs structured object).

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?

A single front-loaded sentence covering all three operations, with no filler. The '(Same as IT-Tools /json-prettify.)' parenthetical is provenance metadata that adds little for an agent choosing or invoking the tool, but it is short and does no harm.

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

Completeness3/5

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

For a simple, read-only, single-input transform with no output schema and only three flat parameters, the definition covers the operations adequately. It leaves open what is returned (formatted text, error object) and how invalid JSON is surfaced, which matters because validation is one of the advertised functions.

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 only 33% — just `indent` is documented — so the description carries extra burden. It partly compensates by linking 'pretty-print or minify' to the indent axis and 'sorting keys' to sortKeys, but it says nothing about the required `json` parameter or whether indent values above 0 scale the output. The remaining ambiguity about indent's effect is left to the schema's '0 minifies' note.

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 names specific operations (validate, pretty-print, minify) on a specific resource (JSON), plus the optional key-sorting behavior. This is clearly distinguishable from converter siblings like json_to_csv and json_yaml_convert, which change format rather than layout, though it never names an alternative explicitly.

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 only implied: an agent infers it should call this when it has a JSON string to reformat. There is no statement of when to use this versus json_yaml_convert or json_to_csv, and no prerequisites or exclusions. The IT-Tools parenthetical identifies provenance, not applicability.

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