repair_markdown
Idempotent
Repair broken Markdown from LLM outputs and copy-paste errors. Fixes unclosed code fences, malformed tables, broken links, and formatting inconsistencies to restore valid document syntax.
Instructions
Repair broken Markdown from LLM output or copy-paste. Fixes unclosed code fences, broken tables (mismatched columns, missing separators), stray emphasis markers, missing heading spaces, inconsistent list indentation, broken links, and excessive whitespace.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| markdown | Yes | The potentially broken Markdown text to repair. | |
| output_path | No | Optional. Absolute or relative file path (e.g. './output.txt') where the result will be saved. Parent directories are created automatically. If omitted, the converted text content is returned directly in the response as a string. If provided, the file is written to disk and a JSON summary with { success, file_path, file_size_bytes, format } is returned instead. |