extract_document_text
Extract plain text from document files (.txt, .md, .csv, .html, .pdf, .docx) by specifying the path. Supports files up to 20MB with configurable size limit.
Instructions
Extract plain text from a document file at a given path. Supports .txt / .md / .csv (read as UTF-8), .html (strip tags), .pdf (regex scrape — best-effort, may return [PDF text extraction yielded nothing] for image-only PDFs), .docx (xml-strip). Default size cap 5MB; override via maxBytes (up to 20MB). Returns {ok, path, ext, sizeBytes, textLength, text}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute or working-dir-relative file path. | |
| maxBytes | No | Max file size to attempt (default 5MB). |