Skip to main content
Glama

B2B, AI RAG, Ad Spy, Finance & UAE Real Estate Suite

LLM Broken JSON Repair & Markdown Fence Extractor

edge_json_repair
Read-onlyIdempotent

Deterministically repair malformed LLM JSON (markdown fences, trailing commas, single quotes, Python True/False/None, unquoted keys). [Price: $0.002 USDC via x402]

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "edge_json_repair"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesBroken JSON or LLM output containing JSON

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, open-world behavior, but the description adds two traits not present in structured data: the repair is deterministic (not an LLM guess), and the call costs $0.002 USDC via x402, which affects whether an agent should invoke it freely. It does not state what the successful response contains, but the determinism and payment disclosures are genuinely additive.

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

Conciseness4/5

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

One dense sentence front-loads the verb and the defect taxonomy, followed by a short bracketed price note. Every clause carries information; the only mild weakness is that the pricing note is appended rather than integrated, but nothing is wasted.

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

Completeness3/5

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

For a single-parameter tool with full schema coverage and annotations, the description covers what is required to call it. The notable gap is return behavior: with no output schema, the definition never says whether the result is a repaired JSON string, an object, or an error on unrepairable input, which an agent needs for downstream chaining.

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 100% and the single 'text' parameter is already documented as 'Broken JSON or LLM output containing JSON'. The description adds no input-shape guidance (e.g., whether fenced or multi-object input is accepted) 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.

Purpose5/5

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

The description names a specific verb ('deterministically repair') and resource ('malformed LLM JSON'), then enumerates the concrete defect classes it handles (markdown fences, trailing commas, single quotes, Python True/False/None, unquoted keys). This makes it immediately distinguishable from siblings such as edge_feed_to_json or edge_web2markdown, which move data between formats rather than repairing broken JSON.

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 defect list implicitly defines the trigger condition: use this when the JSON is broken or fenced. However, there is no explicit 'use when'/'do not use when' phrasing and no named alternative, so an agent must infer that already-valid JSON needs no repair and that generic parsing would suffice.

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.