{"openapi":"3.0.3","info":{"title":"🩹 extract-correct-service","description":"Extracts structured JSON from messy text and, optionally, validates and auto-corrects it against a caller-supplied JSON Schema -- 100% local and deterministic, no LLM call, no network dependency of any kind.","x-guidance":"Extracts structured JSON from messy text and, optionally, validates and auto-corrects it against a caller-supplied JSON Schema -- 100% local and deterministic, no LLM call, no network dependency of any kind.","version":"1.0.0","contact":{"email":"contact@17711.xyz"}},"paths":{"/v1/extract-correct/parse_json":{"post":{"operationId":"extract_correct_parse_json","summary":"JSON repair: extracts structured JSON from messy text or LLM output, optionally validating and auto-correcting it against a JSON Schema ($0.006, x402)","description":"Reads free-form or messy text -- already-valid JSON, JSON wrapped in prose or a markdown code fence, or malformed JSON (trailing commas, single-quoted strings, unquoted keys, a truncated array/object) -- and returns the extracted structured JSON value. 100% local, deterministic extraction and repair (a classical JSON-repair algorithm plus a hand-written balanced-bracket scanner) -- no LLM call, no network dependency of any kind, same output for the same input every time. If a JSON Schema is supplied via `schema`, the extracted value is also validated against it and auto-corrected where a bounded, deterministic fix rule applies -- type coercion between string/number/boolean, filling a missing required property that has a schema-declared default, stripping properties `additionalProperties: false` disallows, case-insensitive enum matching, and clamping out-of-range numbers/arrays to their schema minimum/maximum/maxItems -- never a fuzzy or invented guess: an enum with no exact case-insensitive match, a `pattern`/`format` mismatch, or a `minItems` violation with too few real items is left as-is and reported in `remaining_issues`, never silently guessed or dropped. The response's `extraction_method`, `applied_fixes`, and `remaining_issues` fields make every transformation this tool made -- or couldn't make -- fully transparent. Useful for JSON extraction, JSON repair, cleanup, schema validation, structured-data normalization, and auto-correction of near-miss payloads (e.g. copy-pasted config, an upstream API's loosely-formatted response, a form submission). Free for the first few calls (see the platform's free-quota policy), then a small x402 payment. Free trial: 3 free calls per caller IP address, per tool, per 24 hours (and at most 50 free calls per window for this tool across all callers; MCP callers, whose address is not known, share a single anonymous free call). After that, every call is paid via x402 at $0.006 USDC per call.","x-price-usdc":"0.006","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.006000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"Free-form or messy text to extract structured JSON from -- already-valid JSON, JSON wrapped in prose or a markdown code fence, or malformed JSON (trailing commas, single-quoted strings, unquoted keys, a truncated array/object)."},"schema":{"description":"Optional JSON Schema to validate the extracted value against and auto-correct where a bounded, deterministic fix rule applies. Omitted = extraction only, no validation."}},"required":["text"]},"example":{"text":"string","schema":null}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"description":"The extracted (and, if a schema was supplied, corrected) JSON value."},"extraction_method":{"type":"string","description":"How `data` was obtained: `\"direct\"` (already valid JSON), `\"repaired\"` (malformed JSON fixed in place), or `\"extracted_and_repaired\"` (isolated from surrounding text, then fixed)."},"valid":{"description":"Whether `data` satisfies `schema` after correction. `None` when no `schema` was supplied -- never conflated with \"assumed valid\".","type":["boolean","null"]},"applied_fixes":{"type":"array","items":{"$ref":"#/components/schemas/AppliedFix"},"description":"Every correction actually applied, in the order applied."},"remaining_issues":{"type":"array","items":{"$ref":"#/components/schemas/RemainingIssue"},"description":"Every schema violation that remains after correction -- non-empty only when `schema` was supplied and at least one issue couldn't be fixed by a bounded v1 rule."}},"required":["data","extraction_method","applied_fixes","remaining_issues"]},"example":{"data":null,"extraction_method":"string","valid":false,"applied_fixes":[{"path":"string","rule":"string","detail":"string"}],"remaining_issues":[{"path":"string","keyword":"string","message":"string"}]}}}},"402":{"description":"Payment required -- a free-call quota exists (default 5 calls, see PLATFORM_FREEMIUM_FREE_CALLS) before this status applies; beyond it, pay via the real x402 protocol (PAYMENT-REQUIRED response header, decode and retry with a signed PAYMENT-SIGNATURE header).","content":{"application/json":{"schema":{"type":"object","description":"x402 v2 PaymentRequired challenge","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"resource":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"}}},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"amount":{"type":"string","description":"Token atomic units, NOT decimal USD -- see x-payment-info.price.amount for the decimal form."},"asset":{"type":"string"},"payTo":{"type":"string"},"maxTimeoutSeconds":{"type":"integer"},"extra":{"type":"object"}}}}},"required":["x402Version","accepts"]}}}},"default":{"description":"Standardized error envelope, on every non-2xx response from this fleet: {\"error\": {\"code\": <dotted string, e.g. \"request.bad_request\">, \"index\": <integer>, \"status\": <HTTP status code>, \"message\": <client-safe description>, \"debug\": <object, present only for an authorized caller>}}.","content":{"application/json":{"schema":{"type":"object","description":"ErrorEnvelope"}}}}}}}},"servers":[{"url":"/registry/extract-correct-service"}],"components":{"schemas":{"AppliedFix":{"type":"object","properties":{"path":{"type":"string","description":"JSON Pointer to the field that was corrected (e.g. `/user/age`; `\"\"` = the whole value)."},"rule":{"type":"string","description":"Which bounded correction rule fired (e.g. `type_coercion`, `additional_property_stripped`, `enum_case_insensitive_match`, `required_default_filled`, `clamped_to_minimum`, `clamped_to_maximum`, `array_truncated_to_max_items`)."},"detail":{"type":"string","description":"Human-readable detail of what changed."}},"required":["path","rule","detail"],"description":"One deterministic correction actually applied to the extracted value."},"RemainingIssue":{"type":"object","properties":{"path":{"type":"string","description":"JSON Pointer to the field that still fails validation."},"keyword":{"type":"string","description":"The JSON Schema keyword that failed (e.g. `pattern`, `format`, `minItems`, `oneOf`)."},"message":{"type":"string","description":"The underlying validator's own error message."}},"required":["path","keyword","message"],"description":"One schema violation that could NOT be corrected -- never silently dropped or guessed."}}}}