Skip to main content
Glama

Lordevo Shop (x402 website checks)

JSON repair for LLM output (fences, quotes, commas, truncation) ($0.002/call)

json_repair
Read-onlyIdempotent

$0.002 per call (x402, USDC on Base; free trial: add "trial": true or use try_free). [Data utilities] Turns malformed or LLM-style JSON into valid JSON: removes code fences and leading text, fixes trailing commas, single or smart quotes, unquoted keys, comments, Python constants and truncated endings, and lists the problem types found. Input: json (POST for large input). Limit: 1 MB. Offline.

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": {
      "json": "<json>"
    },
    "name": "json_repair"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsonYesJSON text, up to 1 MB (a JSON value is also accepted in a POST body or MCP arguments)
trialNoOptional. true = free if a trial call is left (3 per IP per UTC day), else the payment terms.

Output Schema

NameRequiredDescriptionDefault
toolNo
cacheNo
fixesNo
_trialNoPresent when the call was a free trial call.
changedNo
providerNo
repairedNo
price_usdNo
input_was_validNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / trial / description
      Previous value: -"Optional. true = answer free if a trial call is left (3 per IP per UTC day); otherwise you get the payment terms."New value: +"Optional. true = free if a trial call is left (3 per IP per UTC day), else the payment terms."
  2. Changed2 schema fields changed
    • addedInput schema / properties / trial
      Added value: +{
      +  "description": "Optional. true = answer free if a trial call is left (3 per IP per UTC day); otherwise you get the payment terms.",
      +  "type": "boolean"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "anyOf": [
      +    {
      +      "required": [
      +        "tool",
      +        "repaired",
      +        "fixes"
      +      ]
      +    },
      +    {
      +      "properties": {
      +        "accepts": {
      +          "type": "array"
      +        },
      +        "error": {
      +          "type": "string"
      +        },
      +        "resource": {
      +          "type": "object"
      +        },
      +        "x402Version": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "x402Version",
      +        "accepts"
      +      ]
      +    },
      +    {
      +      "properties": {
      +        "charged": {
      +          "type": "boolean"
      +        },
      +        "error": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "error"
      +      ]
      +    }
      +  ],
      +  "properties": {
      +    "_trial": {
      +      "description": "Present when the call was a free trial call.",
      +      "type": "object"
      +    },
      +    "cache": {
      +      "type": "object"
      +    },
      +    "changed": {
      +      "type": "boolean"
      +    },
      +    "fixes": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "input_was_valid": {
      +      "type": "boolean"
      +    },
      +    "price_usd": {
      +      "type": "number"
      +    },
      +    "provider": {
      +      "type": "string"
      +    },
      +    "repaired": {
      +      "type": "string"
      +    },
      +    "tool": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Added

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare it read-only, idempotent and offline; the description adds genuinely new operational context: 1 MB input limit, offline processing, that it reports the problem types found, and the pricing/trial mechanics. It does not discuss what happens on unrecoverable input, which is the main remaining gap.

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 cost line, then a bracketed category tag, then the core behavior and limits. Dense and mostly waste-free, though the pricing/trial preamble occupies a third of the text before the actual purpose appears.

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 single-input transformer with an output schema and full annotation coverage, the description supplies the size cap, offline property, cost/trial path and repair scope – enough to invoke it correctly. Only the behavior on unrepairable input is unaddressed.

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%, so the schema already fully defines both `json` and `trial`. The description adds only that large input should go via POST, which is marginal extra meaning.

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?

The description states a specific transformation verb and resource: 'Turns malformed or LLM-style JSON into valid JSON', and enumerates exactly which defects it repairs (fences, trailing commas, smart quotes, unquoted keys, comments, truncation). That distinguishes it in practice from json_validate/json_query, though no sibling is named explicitly.

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 defect list – you call it when the input is malformed rather than merely invalid-but-checkable. There is no explicit routing to json_validate (check only) or json_query (query valid JSON), and no stated exclusions or failure-mode guidance.

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