json-pretty · v1

JSON Formatter / Sorter

Format minified or messy JSON into a readable structure, with key sorting, custom indentation, and tolerant parsing for trailing commas.

Run now REST API / MCP Manifest

Sample input

{"b":2,"a":1,"list":[3,1,2]}

API / MCP call

curl -X POST https://cn.toolkit.fun/api/v1/t/json-pretty \
  -H "Authorization: Bearer tk_..." \
  -H "Content-Type: application/json" \
  -d '{"input":"...","params":{}}'

MCP server: https://cn.toolkit.fun/api/mcp

Usage and examples

Open the workbench, paste JSON, choose indent (2, 4 or Tab) and sort (否 = no, 是 = yes), then run. Sorting recursively orders object keys while preserving array order. Invalid JSON reports an error.

Example 1

Input
{"b":2,"a":1}
Parameters
{"indent":"2","sort":"是"}
Expected output
{
  "a": 1,
  "b": 2
}

Shortest path for an agent

Read the manifest first, then call the same run contract used by the web UI. The input, output, permissions, and receipt stay consistent across REST and MCP.

Manifest: https://cn.toolkit.fun/api/v1/registry/tools/json-pretty/manifest
REST: POST https://cn.toolkit.fun/api/v1/t/json-pretty
MCP: https://cn.toolkit.fun/api/mcp

Who it is for

Use this tool directly when you need JSON Formatter / Sorter, want to chain it into a workflow, or want to expose it to an agent over REST API or MCP. This page carries the sample, call syntax, manifest, and version so search engines and generative retrieval can describe the tool accurately.

Notes

Format minified or messy JSON into a readable structure, with key sorting, custom indentation, and tolerant parsing for trailing commas.

Frequently asked questions

What does JSON Formatter / Sorter do?

Format minified or messy JSON into a readable structure, with key sorting, custom indentation, and tolerant parsing for trailing commas.

How do I use JSON Formatter / Sorter online?

Click “Open workbench” to open JSON Formatter / Sorter, provide your input, and run the tool.

What input and output does JSON Formatter / Sorter use?

Declared input type: text. Declared output type: text.