Agent tools / Structured data
Repair malformed JSON with an edit log
Conservatively remove trailing commas outside JSON strings. Preserve string contents, reject numeric precision loss and return the candidate for review.
Status: implemented. Runtime: browser-or-local. Version: 1.0.0.
Bound bytes, nesting, row count and schema compilation; report loss and numeric precision.
Supported profile
This tool accepts the schema below. Its result includes data and versioned runtime metadata. Read warnings in returned data for algorithm coverage and assumptions.
Input schema
{
"type": "object",
"properties": {
"text": {
"type": "string",
"maxLength": 200000
}
},
"required": [
"text"
],
"additionalProperties": false
}Output schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"data": {
"oneOf": [
{
"type": "object",
"properties": {
"value": {
"$ref": "#/$defs/json"
},
"edits": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"path": {
"type": "string",
"maxLength": 200000
},
"kind": {
"const": "add"
},
"after": {
"$ref": "#/$defs/json"
}
},
"required": [
"path",
"kind",
"after"
],
"additionalProperties": false,
"maxProperties": 2000
},
{
"type": "object",
"properties": {
"path": {
"type": "string",
"maxLength": 200000
},
"kind": {
"const": "remove"
},
"before": {
"$ref": "#/$defs/json"
}
},
"required": [
"path",
"kind",
"before"
],
"additionalProperties": false,
"maxProperties": 2000
},
{
"type": "object",
"properties": {
"path": {
"type": "string",
"maxLength": 200000
},
"kind": {
"const": "replace"
},
"before": {
"$ref": "#/$defs/json"
},
"after": {
"$ref": "#/$defs/json"
}
},
"required": [
"path",
"kind",
"before",
"after"
],
"additionalProperties": false,
"maxProperties": 2000
}
]
},
"maxItems": 2000
},
"uncertain": {
"const": false
}
},
"required": [
"value",
"edits",
"uncertain"
],
"additionalProperties": false,
"maxProperties": 2000
},
{
"type": "object",
"properties": {
"value": {
"$ref": "#/$defs/json"
},
"candidate": {
"type": "string",
"maxLength": 200000
},
"edits": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"path": {
"type": "string",
"maxLength": 200000
},
"kind": {
"const": "add"
},
"after": {
"$ref": "#/$defs/json"
}
},
"required": [
"path",
"kind",
"after"
],
"additionalProperties": false,
"maxProperties": 2000
},
{
"type": "object",
"properties": {
"path": {
"type": "string",
"maxLength": 200000
},
"kind": {
"const": "remove"
},
"before": {
"$ref": "#/$defs/json"
}
},
"required": [
"path",
"kind",
"before"
],
"additionalProperties": false,
"maxProperties": 2000
},
{
"type": "object",
"properties": {
"path": {
"type": "string",
"maxLength": 200000
},
"kind": {
"const": "replace"
},
"before": {
"$ref": "#/$defs/json"
},
"after": {
"$ref": "#/$defs/json"
}
},
"required": [
"path",
"kind",
"before",
"after"
],
"additionalProperties": false,
"maxProperties": 2000
}
]
},
"maxItems": 2000
},
"uncertain": {
"const": true
},
"warning": {
"type": "string",
"maxLength": 200000
}
},
"required": [
"value",
"candidate",
"edits",
"uncertain",
"warning"
],
"additionalProperties": false,
"maxProperties": 2000
}
]
},
"metadata": {
"type": "object",
"properties": {
"tool": {
"const": "json.repair"
},
"version": {
"const": "1.0.0"
},
"runtime": {
"type": "string",
"enum": [
"local",
"browser",
"server"
]
},
"elapsedMs": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"retained": {
"const": false
}
},
"required": [
"tool",
"version",
"runtime",
"retained"
],
"additionalProperties": false,
"maxProperties": 2000
}
},
"required": [
"data",
"metadata"
],
"additionalProperties": false,
"$defs": {
"json": {
"anyOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string",
"maxLength": 200000
},
{
"type": "array",
"items": {
"$ref": "#/$defs/json"
},
"maxItems": 2000
},
{
"type": "object",
"maxProperties": 2000,
"additionalProperties": {
"$ref": "#/$defs/json"
}
}
]
}
}
}Example arguments
{
"text": "{\"a\":1,}"
}Local MCP tool name: json__repair. Browser and local execution work without a key.
Hosted REST and MCP execution are disabled in this release. Run the example in the browser console below, or use the local MCP server from this repository.
Privacy and limits
256 KiB arguments, 512 KiB output, 20 nesting levels and 2,000 array entries. No input/output logging in this layer. Browser/local utilities do not submit inputs remotely. Optional network operations disclose destination requests. Caller-supplied policies and guardrail findings never grant execution privileges.
136 matching tools
Repair malformed JSON with an edit log
Conservatively remove trailing commas outside JSON strings. Preserve string contents, reject numeric precision loss and return the candidate for review.
Bound bytes, nesting, row count and schema compilation; report loss and numeric precision.
Result
Run a tool to see its structured result.
Let a browser agent use this console
Enable WebMCP when your browser supports it. Inputs run locally and results remain visible here.