convert_document
Convert Word, Excel, or PowerPoint documents to PDF, Markdown, HTML, CSV, or JSON while preserving structure. Writes converted file to specified output path.
Instructions
Convert a document between formats while preserving structure where possible: Word (.docx) to PDF/Markdown/HTML, Excel (.xlsx) to PDF/CSV/JSON/HTML, PowerPoint (.pptx) to PDF. Writes the converted file to output_path (default: .). PDF conversion requires office2pdf or LibreOffice to be installed. To read content for analysis instead, use extract_document_data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| options | No | Tool options. | |
| input_path | Yes | Path to the source document. | |
| output_path | No | Output file path. | |
| target_format | Yes | Target output format: - "pdf": PDF document (requires office2pdf or LibreOffice) - "csv": Comma-separated values (Excel only) - "json": JSON array of rows (Excel only) - "html": HTML table (Excel) / styled HTML (Word) - "md"/"markdown": Markdown (Word only) |