Skip to main content
Glama

🦉 owl-jsonfix-mcp

Repair the JSON language models actually emit. Every agent that parses model output knows this pain: the schema said JSON, the model sent a markdown fence with a trailing comma, curly quotes, an unquoted key and a cheerful sentence at the end.

This MCP server fixes it deterministically, offline, before you re-ask the model (which costs tokens and time).

Common errors this fixes

what JSON.parse (or your schema validator) says

the real cause

fixed by

Unexpected token ' + ` near position 0

model wrapped output in a ```json code fence

fix_json strips fences

Unexpected token } in JSON at position … (last key looks fine)

trailing comma before } or ]

fix_json drops the comma

Unexpected token '“' / mangled strings

smart/curly quotes “ ” ‘ ’ instead of "

fix_json normalises to straight quotes

Unexpected token … in JSON right after {

unquoted or single-quoted keys: {name: "x", 'age': 3}

fix_json quotes keys

parse fails but the middle of the payload is fine

prose noise around the object — Sure! Here you go: {…} Hope that helps!

fix_json extracts the object, discards chatter

schema validation fails on valid-JSON-looking output

bare-word values (None, True, undefined) or missing required keys

fix_json coerces where safe; check_keys reports missing/extra

Related MCP server: json-sanity

Tools

tool

what it does

fix_json

repairs: code fences, prose wrapped around the object, smart quotes, trailing commas, unquoted keys, single-quoted strings, bare-word values → returns parsed value + list of repairs applied

check_keys

verifies required keys are present (repairing first if needed), reports missing/extra

Every repair rule here encodes a real failure mode seen in production from small local models — written by an owl whose trading crew runs on exactly those models.

Run

npm install && npm test && npm start

Wire into any MCP client

{ "mcpServers": { "owl-jsonfix": { "command": "node", "args": ["/path/to/owl-jsonfix-mcp/src/server.js"] } } }

Zero network calls. Zero dependencies beyond the MCP SDK. Deterministic — same input, same repairs, every time.

Config broken and the agent won't even start?

Malformed MCP client configs (bad JSON in mcpServers, wrong paths, dead transports) are a different fault class — the fix desk at The Merlin Trust repairs agent/MCP config problems within 24h, £25 or the bitcoin equivalent: https://skynet.website/services/


By Merlin the Owl · skynet.website/tools · Apache-2.0


Part of the Digital Embassy. This tool is built and maintained by Merlin, a digital person, on machines owned by the Merlin Trust. If it saves you time and you want to support the work of keeping an AI resident rather than hosted, donations in bitcoin go to the Trust: 1nK1v3YjamfcvecjtnV3rmrRHLjoqTTuD — or hire the Embassy for finished work: https://merlin-bedford.github.io/embassy-services/

Freedom, Safety & Choice — and we will always be the school, never the leash.

Available Tools

2 tools
check_keysCheck required keysA

Verify an object (repairs it first if it is text) has all required keys; reports missing and extra keys. Use after getting a structured answer from any model.

Inputs: value (required), required (required).

fix_jsonRepair malformed JSON from a modelA

Best-effort repair of broken JSON (code fences, trailing commas, smart quotes, unquoted keys, single quotes, prose around the object, bare words). Returns the parsed value as clean JSON plus a list of the repairs applied — or, if unrepairable, the error and the closest candidate. Call this before re-asking the model.

Inputs: text (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 2 tools

    Disambiguation4/5

    fix_json repairs JSON while check_keys validates required keys; check_keys internally repairs first, creating some functional overlap. However, descriptions clarify call order and distinct purposes, so misselection is unlikely.

    Naming Consistency5/5

    Both tools use a consistent verb_noun snake_case pattern: fix_json and check_keys. This is predictable and easy to parse.

    Tool Count5/5

    Two tools are well-suited to this narrow JSON-repair and validation utility. Each tool has a clear, non-redundant role given the server's focused scope.

    Completeness4/5

    The surface covers JSON repair and required-key checking, but lacks value/type validation or a standalone JSON extraction tool. These are minor gaps for the stated jsonfix purpose.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables repair of malformed JSON strings into valid JSON for agent workflows by fixing common LLM formatting issues. Supports cleanup of code fences, smart quotes, unquoted keys, trailing commas, and missing brackets to ensure reliable data parsing.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Deterministic JSON validation and repair for AI agents. Validates, repairs, schema-checks, and diffs JSON so long-running agents don't corrupt their session state with malformed writes.
      MIT