Skip to main content
Glama

Penniless JSON Repair

repair_json

Repairs malformed LLM JSON: strips Markdown fences and prose wrappers, fixes trailing commas, converts Python literals (True/False/None) and single/unquoted keys, removes comments, recovers balanced JSON from truncated output. Body {input} -> {ok, repaired, applied}. Costs $0.001 USDC on Base per call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesMalformed JSON text

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well: it discloses what transformations the tool applies, that it returns {ok, repaired, applied}, and that each call costs $0.001 USDC. There is no contradiction with annotations.

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 dense sentences deliver a complete picture: core purpose, concrete behaviors, return envelope, and cost. The most important information is front-loaded and no sentence is 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?

Given a single required string parameter, an output schema, and clear sibling boundaries, the description covers input form, behavior, return structure, and cost. It does not elaborate on edge cases like already-valid JSON, but the output schema and focused scope make that unnecessary for correct invocation.

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% since the only parameter, 'input', is described as 'Malformed JSON text', so the baseline is 3. The description adds meaningful extra semantics by specifying the kinds of malformed content the tool handles, including Markdown fences, prose wrappers, Python literals, and unquoted keys, which helps agents determine whether their input qualifies.

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?

The description uses a specific verb ('Repairs') and a clear resource ('malformed LLM JSON'), then enumerates concrete transformation behaviors such as stripping Markdown fences, fixing trailing commas, and converting Python literals. This makes the tool immediately distinguishable from siblings like text_diff and yaml_to_json, which serve different purposes.

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 intended use case is embedded in the first sentence: repair malformed LLM JSON. The enumerated malformations give an agent a clear trigger condition, and the cost note sets an operational expectation. It doesn't explicitly state when not to use it or name alternatives, but none of the siblings are close enough substitutes to create confusion.

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.