JsonMend

Repair broken JSON from LLM output and validate it against a JSON Schema.

사용해야 할까요

품질 및 안전성

A
설명 품질
100%
스키마 완전성
98%
이름 품질
90%
오염 위험
100%
권한 일치
100%
프로토콜 준수
100%

도구 정의와 프로토콜 준수에 대한 자동 분석을 기반으로 합니다.

컨텍스트 비용

~1,966토큰 (도구 정의)
~9.4 KB일반적인 응답 크기
중간 정도의 주의 영향 (128k 컨텍스트의 1.54%)

이는 서버의 도구가 모델의 컨텍스트에 로드될 때마다 소비되는 대략적인 토큰 수입니다. 수치가 높을수록 다른 작업에 사용할 수 있는 주의가 줄어듭니다.

설치

원클릭 설치

`claude_desktop_config.json` 파일에 다음을 추가하세요:

{
  "mcpServers": {
    "jsonmend": {
      "url": "https://jsonmend.mike-tusa.workers.dev/mcp"
    }
  }
}

원격 엔드포인트

https://jsonmend.mike-tusa.workers.dev/mcpstreamable-http

할 수 있는 일

도구 목록

도구 (2)

🟢 읽기 전용🟡 쓰기🔴 삭제⚪ 알 수 없음
🟢repair_json(input, format, schema, coerce, draft)

Turn broken or messy JSON text into valid JSON. Strips Markdown code fences and prose before/after the JSON, removes comments and trailing commas, converts single/curly quotes, quotes unquoted keys, maps Python None/True/False, inserts missing commas, closes truncated strings/arrays/objects, and wraps NDJSON / several concatenated objects into one array. Returns the parsed value (json), the repaired text, and the list of fixes applied; valid input passes through unchanged with no fixes. Optional schema (+ coerce) also validates the result. Fails with isError (code unrepairable / no_json_found) when nothing JSON-like can be recovered. Pure computation: read-only, no network access, inputs not stored. Same engine and limits as POST /api/v1/repair.

입력 스키마

{
  "type": "object",
  "properties": {
    "input": {
      "type": "string",
      "minLength": 1,
      "maxLength": 102400,
      "description": "The raw (possibly broken) JSON text, e.g. an LLM reply with code fences and prose around the JSON. Max 102,400 bytes (UTF-8)."
    },
    "format": {
      "type": "string",
      "enum": [
        "compact",
        "pretty",
        "preserve"
      ],
      "default": "compact",
      "description": "Layout of the returned text: compact (default), pretty (2-space indent), or preserve (jsonrepair's output, keeps original spacing and long-number digits)."
    },
    "schema": {
      "type": "object",
      "description": "A JSON Schema (draft 2020-12 by default; 2019-09, 7 and 4 also supported). Only local $refs (#/...) resolve; remote $refs are an error. Max 32 KB."
    },
    "coerce": {
      "type": "boolean",
      "default": false,
      "description": "Convert values toward the schema's declared types before validating: \"42\" → 42, \"true\" → true, \"null\" → null, 5 → \"5\", x → [x]. Each change is listed in coercions."
    },
    "draft": {
      "type": "string",
      "enum": [
        "2020-12",
        "2019-09",
        "7",
        "4"
      ],
      "description": "JSON Schema draft. Default: from the schema's $schema, else 2020-12."
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}

출력 스키마

{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "changed": {
      "type": "boolean",
      "description": "false when the input was already valid JSON"
    },
    "inputWasValid": {
      "type": "boolean"
    },
    "values": {
      "type": "integer",
      "description": "Number of top-level JSON values found (more than 1 = wrapped in an array)"
    },
    "fixes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "removed_bom",
              "stripped_code_fence",
              "removed_surrounding_text",
              "removed_leading_text",
              "removed_trailing_text",
              "extra_closing_brackets",
              "wrapped_multiple_values",
              "comments",
              "single_quotes",
              "smart_quotes",
              "unquoted_keys",
              "unquoted_strings",
              "trailing_commas",
              "extra_commas",
              "missing_commas",
              "missing_colons",
              "python_literals",
              "non_json_literals",
              "invalid_numbers",
              "control_characters",
              "truncated",
              "other_syntax_fixes"
            ]
          },
          "message": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": 2
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    },
    "json": {
      "description": "The repaired JSON value (coerced if coerce was used)"
    },
    "format": {
      "type": "string",
      "enum": [
        "compact",
        "pretty",
        "preserve"
      ]
    },
    "inputBytes": {
      "type": "integer"
    },
    "outputBytes": {
      "type": "integer"
    },
    "schema": {
      "type": "object",
      "properties": {
        "valid": {
          "type": "boolean"
        },
        "errorCount": {
          "type": "integer",
          "description": "Total errors (at most 50 are listed); a lower bound when errorsTruncated is true"
        },
        "errorsTruncated": {
          "type": "boolean",
          "description": "true when the validator produced more than 5,000 raw errors and only the first 5,000 were examined"
        },
        "errors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string",
                "description": "JSON Pointer to the failing value (\"\" = root)"
              },
              "keyword": {
                "type": "string"
              },
              "schemaPath": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "path",
              "keyword",
              "message"
            ]
          }
        },
        "draft": {
          "type": "string",
          "enum": [
            "2020-12",
            "2019-09",
            "7",
            "4"
          ]
        },
        "coerced": {
          "type": "boolean"
        },
        "coercions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string"
              },
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "path",
              "from",
              "to"
            ]
          }
        }
      },
      "required": [
        "valid",
        "errorCount",
        "errors"
      ]
    },
    "plan": {
      "type": "string",
      "enum": [
        "anonymous",
        "key"
      ]
    },
    "version": {
      "type": "string"
    }
  },
  "required": [
    "ok",
    "changed",
    "inputWasValid",
    "fixes",
    "json"
  ]
}
🟢validate_json(schema, input, data, coerce, draft)

Check JSON against a JSON Schema and get every error with its JSON Pointer path. Send the JSON either as text ("input"; broken text is repaired first, and the fixes are listed) or as an already-parsed value ("data"). Optional coerce converts "42" → 42, "true" → true, etc. toward the schema's types before validating and lists each change. A schema mismatch is a normal result (valid: false), not an error. Drafts 2020-12 (default), 2019-09, 7, 4; only local $refs. Pure computation: read-only, no network access, inputs not stored. Same engine and limits as POST /api/v1/validate.

입력 스키마

{
  "type": "object",
  "properties": {
    "schema": {
      "type": "object",
      "description": "A JSON Schema (draft 2020-12 by default; 2019-09, 7 and 4 also supported). Only local $refs (#/...) resolve; remote $refs are an error. Max 32 KB."
    },
    "input": {
      "type": "string",
      "minLength": 1,
      "maxLength": 102400,
      "description": "JSON text to validate (repaired first if broken). Send this or \"data\", not both. Max 102,400 bytes."
    },
    "data": {
      "description": "An already-parsed JSON value to validate. Send this or \"input\", not both."
    },
    "coerce": {
      "type": "boolean",
      "default": false,
      "description": "Convert values toward the schema's declared types before validating: \"42\" → 42, \"true\" → true, \"null\" → null, 5 → \"5\", x → [x]. Each change is listed in coercions."
    },
    "draft": {
      "type": "string",
      "enum": [
        "2020-12",
        "2019-09",
        "7",
        "4"
      ],
      "description": "JSON Schema draft. Default: from the schema's $schema, else 2020-12."
    }
  },
  "required": [
    "schema"
  ],
  "additionalProperties": false
}

출력 스키마

{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    },
    "errorCount": {
      "type": "integer",
      "description": "Total errors (at most 50 are listed); a lower bound when errorsTruncated is true"
    },
    "errorsTruncated": {
      "type": "boolean",
      "description": "true when the validator produced more than 5,000 raw errors and only the first 5,000 were examined"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "JSON Pointer to the failing value (\"\" = root)"
          },
          "keyword": {
            "type": "string"
          },
          "schemaPath": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "keyword",
          "message"
        ]
      }
    },
    "draft": {
      "type": "string",
      "enum": [
        "2020-12",
        "2019-09",
        "7",
        "4"
      ]
    },
    "coerced": {
      "type": "boolean"
    },
    "coercions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "from",
          "to"
        ]
      }
    },
    "repaired": {
      "type": "boolean",
      "description": "true when \"input\" needed repair before validation"
    },
    "fixes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "removed_bom",
              "stripped_code_fence",
              "removed_surrounding_text",
              "removed_leading_text",
              "removed_trailing_text",
              "extra_closing_brackets",
              "wrapped_multiple_values",
              "comments",
              "single_quotes",
              "smart_quotes",
              "unquoted_keys",
              "unquoted_strings",
              "trailing_commas",
              "extra_commas",
              "missing_commas",
              "missing_colons",
              "python_literals",
              "non_json_literals",
              "invalid_numbers",
              "control_characters",
              "truncated",
              "other_syntax_fixes"
            ]
          },
          "message": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": 2
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    },
    "json": {
      "description": "The validated value (after repair and coercion)"
    },
    "plan": {
      "type": "string",
      "enum": [
        "anonymous",
        "key"
      ]
    },
    "version": {
      "type": "string"
    }
  },
  "required": [
    "ok",
    "valid",
    "errorCount",
    "errorsTruncated",
    "errors",
    "json"
  ]
}

커뮤니티

이 서버 평가하기

증거

최근 관측

검증됨버전이 기록되지 않음도구 2개