read_document_as_markdown
Convert PDF, Word, PowerPoint, HTML, EPUB, email, spreadsheets, and 200+ text formats into Markdown, with optional section extraction for targeted reading.
Instructions
Read a document and convert it to Markdown format (simplified API).
Supports PDF, Word (DOCX), PowerPoint (PPTX), HTML, email (EML), EPUB, Jupyter Notebooks (IPYNB), Excel (XLSX/CSV), ODF formats, and 200+ text formats.
The source parameter is auto-detected as:
File path (if file exists in read allowlist)
Data URI (data:image/...)
Base64-encoded content (auto-detected)
Plain text content (HTML, Markdown, etc.)
Optionally extract a specific section by providing the section parameter with a heading name (case-insensitive match).
Image inclusion and markdown flavor are configured at server startup and cannot be changed per-call.
Returns the Markdown as a text content block, followed by an image content block for each image found (when include_images=true), so vision models can see the images alongside the text. When include_images=false, only the text, with image alt text in place of the images.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Unified source parameter. Auto-detected as: file path (if exists in read allowlist), data URI (data:...), base64 string, or plain text content. REQUIRED. | |
| section | No | Optional section name to extract (case-insensitive heading match). If provided, only that section is returned. | |
| pdf_pages | No | Page specification for PDF sources only. Examples: '1-3' (pages 1-3), '1,3,5' (specific pages), '1-3,5,10-' (ranges and individual pages), '1-' (from page 1 to end). | |
| format_hint | No | Optional format hint for ambiguous cases (e.g., extensionless files). Options: auto (default), pdf, docx, pptx, html, eml, epub, ipynb, odt, odp, ods, xlsx, csv, rst, markdown, txt. |