Skip to main content
Glama

mechacut

json_repair

Repair broken JSON text deterministically (markdown fences, BOM, smart/single quotes, comments, bare keys, trailing commas, Python literals, JSONL). Returns the parsed value + repairs applied. Free.

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": "json_repair"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesthe broken JSON text

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?

With no annotations, the description carries the whole burden and does reasonably well: it discloses determinism, the specific repair classes attempted, and the return contract ('parsed value + repairs applied'). The notable gap is failure behavior — it does not say whether unrepairable input yields an error, null, or partial output.

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 action and the input scope, then the return contract. The parenthetical list is dense and every item is informative; nothing needs reordering or pruning.

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?

For a one-parameter pure function with no annotations and no output schema, the description covers action, accepted malformations, and return shape, which is nearly everything an agent needs. It lacks only the error/unrepairable-input path and any size or rate caveat.

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% for the single 'text' parameter, so the baseline is 3. The description adds only indirect meaning — the mention of markdown fences and JSONL hints that wrapped or line-delimited input is acceptable — but gives no format detail beyond what the schema already says.

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

Purpose4/5

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 exact failure classes it handles (fences, BOM, smart quotes, comments, bare keys, trailing commas, Python literals, JSONL), which lets an agent tell it apart from normalize-style siblings. It never names a sibling such as validate_json or json_canonical to draw a hard boundary, so it stops short of a 5.

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?

Usage is implied by the failure-class list: you invoke this when the input text is malformed in one of those ways. There is no explicit when-not guidance (e.g. 'use validate_json to check without mutating, use json_canonical for already-valid input') and no statement about what happens if the text is unrepairable.

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.