Skip to main content
Glama

ScorpTech x402 Tools

Json Repair

json_repair
Read-onlyIdempotent

Repair broken or LLM-style JSON into valid JSON: strips markdown fences and surrounding prose, comments, trailing/missing commas, single or smart quotes, unquoted keys and values, Python/JS literals (True/None/undefined), NaN/Infinity, unescaped inner quotes and control characters, truncated output (closes open strings/arrays/objects) and mismatched brackets. Reports every fix applied, the original parse error, type and size stats, and optionally runs a JSONPath query ($.a.b[0], [*], .., slices, unions, filters) on the result. Offline; 200 KB. Returns JSON with: valid, repaired, parseError, fixes, type, stats, json, text. Price: $0.005 USDC per successful call (x402, Base or Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/json-repair

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 (aliases: json, input). Max 200 KB
queryNoOptional JSONPath to evaluate on the repaired value
prettyNoAlso return the repaired JSON pretty-printed (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive safety. The description adds genuinely non-annotated traits: offline execution, a 200 KB ceiling, the x402 payment requirement and price, and the fact that every fix plus the original parse error is reported. It stops short of explaining edge-case behavior (e.g., what happens when repair is impossible) or the text/json field distinction in detail.

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?

Front-loaded with the core purpose and repair list, then behavior, returns, and pricing. The repair enumeration is a long run-on but each item is informative; the pricing and HTTPS endpoint lines are operationally useful rather than 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?

No output schema exists, and the description compensates by naming the returned fields (valid, repaired, parseError, fixes, type, stats, json, text). Combined with the size limit, payment model, and repair scope, an agent has everything needed to call it correctly.

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. The description earns above baseline by giving JSONPath syntax examples for the optional query ('$.a.b[0], [*], .., slices, unions, filters'), which tells the agent the evaluator's capability surface beyond the schema's one-line note.

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 ('repair') and resource ('broken or LLM-style JSON') and enumerates the concrete defect classes handled (fences, comments, trailing commas, smart quotes, Python/JS literals, truncation, mismatched brackets). An agent can distinguish this from json_canonicalize or jsonpath without opening the schema.

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 context of use (malformed or LLM-generated JSON) is implied clearly, but there is no explicit routing guidance such as 'use jsonpath instead if the JSON is already valid' or 'do not use for validation'. Usage is inferable from the description 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