mcpField
J
json-formatter

json-formatter

github.com/thomasholknielsenDevelopment39 installs
Repository

About json-formatter

A skill for formatting, validating, and prettifying JSON. It parses supplied JSON and returns valid, consistently indented output, or explains syntax errors and suggests corrections.

Key features

  1. 01Parse and validate JSON
  2. 02Format with two-space indentation
  3. 03Handle minified JSON
  4. 04Explain syntax errors
  5. 05Preserve JSON data types

Use cases

  1. 01Prettifying minified JSON
  2. 02Checking JSON before use
  3. 03Diagnosing malformed JSON
  4. 04Standardizing indentation in JSON

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/thomasholknielsen/claude-code-config --skill json-formatter

After installing, type/json-formatterin Claude Code to confirm it loaded.

Details

From the project README

JSON Formatter

Instructions

When asked to format, validate, or prettify JSON:

  1. Identify the JSON data (raw, minified, or malformed)
  2. Parse and validate the structure
  3. Return properly formatted JSON with:
    • Consistent 2-space indentation
    • Proper line breaks
    • Valid syntax

Examples

Example 1: Minified JSON

Input:

{"name":"John","age":30,"city":"New York","hobbies":["reading","gaming"]}

Output:

{
  "name": "John",
  "age": 30,
  "city": "New York",
  "hobbies": [
    "reading",
    "gaming"
  ]
}
Example 2: Validating JSON

If JSON is invalid, explain the issue and suggest a fix:

{"incomplete": "data",}  // trailing comma

Response: "Invalid JSON: Trailing comma after last property. Remove the comma before the closing brace."

Best Practices

  • Use 2-space indentation for consistency
  • Sort object keys alphabetically when helpful
  • Validate before formatting
  • Preserve original data types (strings, numbers, booleans, null)

Comments

Markdown supported