Skip to main content
Glama

json-repair

Repair malformed JSON / LLM output: convert common broken JSON into valid structured JSON. Removes Markdown-style fences and prose wrappers, trailing commas, normalizes Python True/False/None and smart quotes, and repairs common single-quoted keys and values. Returns the parsed result plus applied repair steps. Costs $0.001 USDC on Base via x402.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden, and it does well: it discloses the concrete repair operations, the return shape ('parsed result plus applied repair steps'), and a notable non-obvious trait, the $0.001 USDC on Base via x402 payment requirement. It does not state behavior on unrepairable input or the 250000-char limit, which keeps it short of a 5.

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?

Two sentences, front-loaded with the core purpose and the transformation list, then the return value and the payment cost. No filler or repetition.

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

Completeness4/5

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

With no output schema, the description correctly explains what is returned (parsed result plus applied repair steps), and it surfaces the payment requirement an agent would otherwise be surprised by. The only gap is failure/edge-case behavior on irreparable input.

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

Parameters3/5

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

Schema description coverage is 0% for the single 'text' parameter, so the schema supplies only type and maxLength. The description tells the agent what kind of content goes in (malformed JSON / LLM output) but never states the size cap or that the input is a raw string blob. Adequate, not compensating fully for the coverage gap.

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?

Specific verb (repair/convert) plus resource (malformed JSON / LLM output), and it enumerates the concrete transformations performed (fences, trailing commas, Python literals, smart quotes, single quotes). This clearly separates it from siblings like json-canonicalize (normalizing valid JSON) and json-schema-validate (checking validity).

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

Usage Guidelines3/5

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

The scope implies when to use it ('broken JSON'), but no explicit when/when-not guidance and no sibling is named as an alternative. An agent can infer usage from 'malformed', but the boundary against json-canonicalize and json-schema-validate is left to inference.

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.