Skip to main content
Glama

Repair near-miss LLM JSON to a schema (paid $0.002)

json_repair

Repair malformed LLM JSON to conform to a JSON Schema, returning the corrected object or precise field errors.

Instructions

PAID $0.002 (x402, USDC on Base). Coerce near-miss LLM JSON to a JSON-Schema-conformant object: strip code fences/prose, fix trailing commas/quotes/unquoted keys, normalise Python literals, balance brackets, then coerce types, apply defaults, and drop extraneous keys. Returns the repaired object OR precise per-field errors. Args: json (the raw string), schema (a JSON Schema object). Without payment returns the x402 challenge.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonYesThe raw, possibly-malformed JSON text to repair.
schemaYesA JSON Schema (draft 2020-12) object the result must conform to.
x_paymentNox402 payment payload (base64) for this PAID check. If supplied it is forwarded as the X-PAYMENT header to settle the call and return the real result instead of a 402 challenge. Omit to get the price challenge first.
Behavior5/5

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

No annotations provided, so description carries full burden. It discloses payment requirement ($0.002 via x402), the sequence of repair operations, return payloads (repaired object or errors), and the unpaid challenge response. This is comprehensive for a tool of this complexity.

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?

Compact yet information-dense. The paid warning is front-loaded, followed by a precise list of transformations and return behavior. Every clause adds value without redundancy.

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?

Covers payment flow, transformation steps, outputs, and parameter purposes. Despite no output schema, the return types are explicitly described. The description fully equips an agent to invoke and interpret results.

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?

Input schema already provides detailed descriptions for all three parameters (100% coverage). The description merely restates json/schema args, adding no new semantic value over the schema. Baseline of 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?

Clearly states the tool repairs near-miss LLM JSON to a JSON-Schema-conformant object, with explicit operations (strip fences, fix quotes, coerce types). It is distinct from sibling tools (deps_check, x402_preflight, url_read) 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?

Provides clear context: use for near-miss LLM JSON that needs coercion to a schema. Mentions the payment prerequisite and fallback behavior. Does not explicitly name alternatives or exclusions, but context is unambiguous given siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zvmzaretsky/fabtally-guard-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server