convert_to_markdown
Convert local PDFs, Office files, images, and audio to clean Markdown automatically, saving a .md file beside the original—no upload needed.
Instructions
Convert a document on this machine to clean Markdown. Handles PDF, Word (.docx), Excel (.xlsx/.xls/.xlsm), PowerPoint (.pptx), OpenDocument text and spreadsheets (.odt/.ods), EPUB, CSV/TSV and plain text. Images are read with OCR, and audio is transcribed. Conversion happens locally and the file is not uploaded, except for the image and audio cases noted in ocr_mode. Prefer this over reading a binary file directly.
The Markdown is SAVED AUTOMATICALLY as a .md file beside the original, so the user does not need to ask. Short documents are also returned in full; long ones come back as a preview plus the saved path, to avoid filling the conversation with tens of thousands of words. If you need more of a long document than the preview shows, call this again with return_content "full".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the file to convert. | |
| save | No | Set false to skip writing the .md file. Default true — the file is saved beside the original without needing to be asked for. | |
| save_to | No | Absolute path to write the .md to, overriding the default of beside the original. | |
| ocr_mode | No | For images only. "offline" (default) runs on this machine and uploads nothing. "cloud" sends the image to Google Gemini, which is more accurate and can describe charts, and requires GEMINI_API_KEY. | |
| overwrite | No | Set true to replace an existing .md of the same name. Default false, in which case a numbered name is used instead so nothing is destroyed. | |
| return_content | No | "auto" (default) returns the whole document if it is short, otherwise a preview and the saved path. "full" always returns everything — use only when the user genuinely needs the entire text in the conversation, as a long document can be tens of thousands of tokens. "none" saves and reports the path only, which is cheapest when the user just wants the file. |