Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

format_json

Read-onlyIdempotent

Validate and pretty-print a string that is ALREADY valid JSON. Strict by design — it is a validity gate: valid JSON comes back formatted, anything else is rejected with the exact parse error. It never repairs, completes, or guesses. NOT for: plain text or prose (will fail), JSON embedded in markdown/prose (extract_json_from_text pulls it out), JS objects (JSON.stringify them first), YAML (yaml_to_json reads it).

Input Schema

NameRequiredDescriptionDefault
inputYesA raw JSON string, e.g. '{"key":"value"}'. Must already parse as JSON — plain text or truncated JSON is rejected, not repaired.
indentNoIndent size (default: 2)

Output Schema

NameRequiredDescriptionDefault
validNo
formattedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "input": "{\"a\":1,\"b\":{\"a\":2}}"
      +  }
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / input / description
      Previous value: -"Raw JSON string to format"New value: +"A raw JSON string, e.g. '{\"key\":\"value\"}'. Must already parse as JSON — plain text or truncated JSON is rejected, not repaired."
  3. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "formatted": {
      +    "type": "string"
      +  },
      +  "valid": {
      +    "type": "boolean"
      +  }
      +}
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  5. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.