write_document
Generate and save document files automatically in HTML, Markdown, plain text, or DOCX formats. Specify content, encoding, and optional title; files are saved to OUTPUT_DIR with intelligent format detection.
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
Name | Required | Description | Default |
---|---|---|---|
content | Yes | Content to write | |
encoding | No | File encoding | utf-8 |
format | No | Force specific format: html, md, txt, docx (optional, auto-detected if not specified) | |
title | No | Document title (optional, used for filename generation) |
Input Schema (JSON Schema)
{
"properties": {
"content": {
"description": "Content to write",
"type": "string"
},
"encoding": {
"default": "utf-8",
"description": "File encoding",
"type": "string"
},
"format": {
"description": "Force specific format: html, md, txt, docx (optional, auto-detected if not specified)",
"enum": [
"html",
"md",
"txt",
"docx"
],
"type": "string"
},
"title": {
"description": "Document title (optional, used for filename generation)",
"type": "string"
}
},
"required": [
"content"
],
"type": "object"
}