write_document
Write content to document files in HTML, Markdown, plain text, or DOCX formats. Automatically saves files with intelligent format detection and organized naming.
Instructions
Write content to document files in specified formats. Output directory is controlled by OUTPUT_DIR environment variable. Files will be automatically saved to OUTPUT_DIR with auto-generated names based on content type (HTML, Markdown, or plain text). Supports intelligent format detection.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Content to write | |
| encoding | No | File encoding | utf-8 |
| title | No | Document title (optional, used for filename generation) | |
| format | No | Force specific format: html, md, txt, docx (optional, auto-detected if not specified) |
Implementation Reference
- src/tools/conversionPlanner.ts:81-87 (helper)Helper mapping in ConversionPlanner that associates converting from TXT format to HTML, Markdown, MD, DOCX, or PDF with the 'write_document' tool name. This is the only reference to the tool in the codebase, suggesting it may be planned or external.txt: { html: 'write_document', markdown: 'write_document', md: 'write_document', docx: 'write_document', pdf: 'write_document', },