JsonMend
Server Details
Repair broken JSON from LLM output and validate it against a JSON Schema.
- Status
- Healthy
- Last Tested
- Transport
- Streamable HTTP · MCP 2025-11-25
- URL
TDQS
Scored across 2 tools
repair_json and validate_json target clearly different outcomes: one returns repaired text/parsed value, the other returns schema validation errors. The descriptions explicitly clarify that validate_json can repair broken text on input, so the internal overlap is disclosed rather than confusing. An agent can select between them without ambiguity.
Both names follow a strict verb_noun snake_case pattern (repair_json, validate_json) using the same noun, so the convention is perfectly predictable. No mixed styles, casing, or verb forms appear.
Two tools is slightly thin, but the server's scope (a pure-computation JSON repair/validate utility) is narrow enough that both operations are the natural core. No tool feels redundant or filler.
Repair plus schema validation covers the main use cases for a JSON-fixing service, including NDJSON and coercion. Minor gaps exist (e.g. pretty-print/minify or JSON Pointer querying), but these are conveniences an agent can work around rather than dead ends.
Available Tools
2 toolsrepair_jsonRepair broken JSON (LLM output) and list the fixesARead-onlyIdempotentInspect
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.
| Name | Required | Description | Default |
|---|---|---|---|
| draft | No | JSON Schema draft. Default: from the schema's $schema, else 2020-12. | |
| input | Yes | 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). | |
| coerce | No | 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. | |
| format | No | Layout of the returned text: compact (default), pretty (2-space indent), or preserve (jsonrepair's output, keeps original spacing and long-number digits). | compact |
| schema | No | 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. |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | Yes | |
| json | Yes | The repaired JSON value (coerced if coerce was used) |
| plan | No | |
| fixes | Yes | |
| format | No | |
| schema | No | |
| values | No | Number of top-level JSON values found (more than 1 = wrapped in an array) |
| changed | Yes | false when the input was already valid JSON |
| version | No | |
| warnings | No | |
| inputBytes | No | |
| outputBytes | No | |
| inputWasValid | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Goes well beyond the annotations: discloses the exact failure codes (unrepairable / no_json_found) via isError, the return payload contents, the no-network/no-storage guarantee, and the shared engine and limits with POST /api/v1/repair. That is the kind of mutation-free, idempotent behavioral contract an agent needs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Information-dense rather than padded: the repair list is front-loaded, then returns, then error behavior, then the purity/limits note. The long enumeration of repairs is justified by the breadth of the tool, though it makes the paragraph dense enough to be borderline.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description does not need to explain return values in detail, yet it still names them. Combined with error semantics, idempotency, input limits and the purity guarantee, an agent has everything needed to call this correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents input, schema, coerce, draft and format with examples. The description adds only a light interaction note ('optional schema (+ coerce) also validates the result') and no syntax or format guidance beyond the schema, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource (repair broken JSON text) and enumerates the concrete repair classes it performs, so the agent knows exactly what transformation happens. It does not explicitly name or contrast with the sibling validate_json, though the line about optional schema validation hints at the overlap.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear context for when to reach for it (broken or messy JSON, e.g. an LLM reply with fences and prose) and states that valid input passes through unchanged, which tells the agent it is safe to call speculatively. It never explicitly routes the agent to validate_json for pure validation, so no exclusion is given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
validate_jsonValidate JSON against a JSON Schema (repairs broken input first)ARead-onlyIdempotentInspect
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.
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | An already-parsed JSON value to validate. Send this or "input", not both. | |
| draft | No | JSON Schema draft. Default: from the schema's $schema, else 2020-12. | |
| input | No | JSON text to validate (repaired first if broken). Send this or "data", not both. Max 102,400 bytes. | |
| coerce | No | 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. | |
| schema | Yes | 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. |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | Yes | |
| json | Yes | The validated value (after repair and coercion) |
| plan | No | |
| draft | No | |
| fixes | No | |
| valid | Yes | |
| errors | Yes | |
| coerced | No | |
| version | No | |
| repaired | No | true when "input" needed repair before validation |
| warnings | No | |
| coercions | No | |
| errorCount | Yes | Total errors (at most 50 are listed); a lower bound when errorsTruncated is true |
| errorsTruncated | Yes | true when the validator produced more than 5,000 raw errors and only the first 5,000 were examined |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Adds substantial context beyond the annotations: pure computation, no network access, inputs not stored, only local $refs resolve, remote $refs error, size limits, and that a schema mismatch is a normal result rather than an error. This goes well past the readOnlyHint/idempotentHint safety profile.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Dense but front-loaded: the core action and error output come first, then input-vs-data, coerce, and limits. Every sentence carries information, though the final runtime/endpoint details add slight bulk.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given an output schema exists, the description need not explain return values, and annotations plus text cover safety, determinism, limits, and repair/coerce behavior. An agent has everything needed to call this correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the structured fields already document all five parameters. The description still adds meaning by illustrating coercion directionality ('42' → 42, 5 → '5') and noting that changes are reported in a 'coercions' list.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('Check JSON against a JSON Schema') and scopes the outcome ('every error with its JSON Pointer path'). It also distinguishes itself from the sibling repair_json by framing repair as a preliminary side effect rather than the purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear selection guidance between 'input' and 'data' and explains when to use 'coerce'. It does not name repair_json explicitly as the alternative for pure-fix workflows, but the usage context is otherwise unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
- First observed
repair_json - First observed
validate_json
Related MCP Connectors
Repair malformed JSON from LLM/agent output; optional JSON Schema coercion. Free + x402 paid.
Repair malformed JSON that fails a schema. Deterministic only; refuses to guess; signed receipt.
Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, unquoted keys).
Deterministic JSON repair, validate, example-gen, schema-coerce for agents. Zero LLM, sub-10ms.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides deterministic JSON repair and JSON Schema validation for malformed AI agent outputs, safely fixing unambiguous errors without an LLM and refusing ambiguous cases.75 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceDeterministic JSON validation and repair for AI agents. Validates, repairs, schema-checks, and diffs JSON so long-running agents don't corrupt their session state with malformed writes.MIT
- FlicenseNot gradedqualityBmaintenanceEnables agents and MCP clients to deterministically extract and repair JSON/schema issues such as truncated braces, markdown wrappers, and invalid types without LLM round-trips.7-
- FlicenseNot gradedqualityBmaintenanceEnables MCP-compatible agents and IDEs to deterministically extract JSON and auto-repair malformed schemas, including truncated braces, markdown wrappers, and invalid types, without LLM round-trips.7-
Glama MCP Gateway
Add one secure layer between your agents and this server.