Repair JSON in a local file
repair_json_fileRead and repair broken or incomplete JSON from a local UTF-8 file without changing the source. Use it for files up to 5 MB when you need to fix JSON without pasting text.
Instructions
Read a local JSON file and repair it if it is broken or incomplete.
Use this when the JSON is in a file on this computer, so you don't have to paste it. The file is only read, never changed. Files larger than 5 MB are rejected; use the Apify version for bigger jobs. Do not use it for files that are not JSON text.
path: full path to a UTF-8 text file, up to 5 MB. json_lines: if true, each non-empty line is a separate document. If false (default), the whole text is tried as one JSON value first.
Returns the same object as repair_json_text.
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": {
"path": "<path>"
},
"name": "repair_json_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Full path to a UTF-8 .json or .jsonl file, up to 5 MB. | |
| json_lines | No | If true, treat each non-empty line as its own JSON document. |