Export Project To File
export_projectExport a Scrivener project to publishing or interchange formats. Text formats (Markdown, HTML, JSON) return content inline; binary formats (DOCX, EPUB, PDF) save to disk.
Instructions
Export the whole project to a publishing/interchange format. Markdown, HTML, and JSON are returned inline; DOCX (agent/editor submission), EPUB (e-readers), and PDF (print/review) are written to a file on disk and the path is returned. Use this to produce a deliverable file; use compile_documents when you want the compiled text back in the response rather than written to disk. Requires an open project.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | Target file format. Text formats (markdown, html, json) return their content inline; binary formats (docx, epub, pdf) are written to a file and return its path. | |
| options | No | Optional format-specific export options (e.g. metadata, styling). | |
| outputPath | No | Absolute or project-relative path to write the exported file. Omit to use a default location (the working directory, named after the project title). Required in effect only if you want a specific location for docx/epub/pdf. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path of the written file (binary formats: docx, epub, pdf). | |
| bytes | No | Size of the written file in bytes (binary formats only). | |
| format | Yes | Format the project was exported to (markdown, html, json, docx, epub, or pdf). | |
| content | No | The exported document content (text formats only). | |
| metadata | Yes | Export metadata: exportDate, format, and documentCount (number of documents exported). |