Universal Document Reader
Purpose
Return extracted text from any supported file in a single unified JSON envelope. The tool dispatches by file extension — you always call the same tool regardless of format.
Supported formats
| Category | Extensions | Notes |
|---|---|---|
.pdf | Text pages extracted in ms; scanned/image pages fall back to OCR | |
| Word | .docx | Paragraphs + table cells |
| Excel | .xlsx, .xls | All sheets, first 100 rows per sheet as preview |
| PowerPoint | .pptx | Slide text content |
| Images | .png/.jpg/.jpeg/.gif/.bmp/.webp/.tiff | OCR only |
| CSV / TSV | .csv, .tsv | Raw text with encoding fallback |
| Plain text | .txt/.md/.log/.rst | Encoding fallback |
| Config | .json/.yaml/.yml/.toml/.ini/.cfg/.env | Raw text |
| Markup | .html/.htm/.xml | Raw text (no HTML stripping) |
| Source code | .py/.js/.ts/.tsx/.go/.rs/.java/.cpp/.c/.sql/.sh/... | Raw text |
| Unknown extension | anything else | Best-effort read as UTF-8/GBK text |
Blocked (rejected at /upload): executables (.exe/.dll/.so/...) and
archives (.zip/.tar/...). Ask the user to unpack archives locally first.
Usage
**Always call the tool dire…