Skip to main content
Glama

Json Repair

json_repair
Read-only

Repairs broken JSON: markdown fences, comments, trailing commas, single quotes, unquoted keys, Python literals (True, False, None) and truncated endings. Pure code first; the model is asked once only when code cannot repair it. Optional JSON Schema check covers type, required, properties, items, enum, minimum, maximum, minLength, maxLength and pattern. Input max 1 MB. Price: $0.002 in USDC per successful call, paid with x402 (Base, Solana or Arc); failed calls are not charged.

Input Schema

NameRequiredDescriptionDefault
textYesThe broken JSON text (max 1 MB)
schemaNoOptional JSON Schema to validate the repaired value against

Output Schema

NameRequiredDescriptionDefault
fixesNo
validNo
valueNo
problemsNo
checkedAtNo
usedModelNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedOutput schema / properties / checkedAt
      Added value: +{}
    • addedOutput schema / properties / fixes
      Added value: +{}
    • addedOutput schema / properties / problems
      Added value: +{}
    • addedOutput schema / properties / usedModel
      Added value: +{}
    • addedOutput schema / properties / valid
      Added value: +{}
    • addedOutput schema / properties / value
      Added value: +{}
  2. Added

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the readOnlyHint/openWorldHint annotations: a deterministic-first then single model fallback, a 1 MB input cap, and a paid x402 pricing model ($0.002 USDC per successful call on Base, Solana or Arc) with failed calls free. The payment and billing-failure semantics are exactly the context an agent needs before invoking a paid tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, all front-loaded: capability first, then fallback strategy, then validation scope, then limits and price. No restatement of the title and no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need no explanation. Given only two parameters, the description still covers everything an agent must know before calling: input size limit, what validation is supported, the model-fallback behavior, and the payment requirement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: it restates the 1 MB cap on 'text' and spells out which JSON Schema keywords the optional validation actually enforces (type, required, properties, items, enum, minimum/maximum, minLength/maxLength, pattern), which the schema property text does not.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Repairs broken JSON') and then enumerates the exact failure modes handled: markdown fences, comments, trailing commas, single quotes, unquoted keys, Python literals, truncated endings. That enumeration distinguishes it from the sibling json_validate, which checks rather than fixes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The line 'Pure code first; the model is asked once only when code cannot repair it' tells the agent the repair strategy and its cost/latency implications. It does not explicitly say 'use json_validate instead when the JSON is already well-formed,' so the sibling routing is inferred rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources