write_file
Create or replace files with UTF-8 text, PDF, or DOCX using HTML formatting. Supports rich formatting like headings, tables, and styles.
Instructions
Create/replace files. Supports text (UTF-8), PDF, and DOCX with HTML formatting.
PDF/DOCX with HTML Formatting:
Provide HTML content for rich formatting (headings, bold, italic, colors, tables, lists)
Supports: -, , , , , , , , ,
CSS styling: colors, fonts, alignment, borders, margins, padding
Example: 'TitleContent'
Plain text fallback: If content is not HTML, creates simple formatted document
Text files: UTF-8 encoding. Overwrites without confirmation.
IMPORTANT - Multi-line Content:
Use actual newline characters in the content string, NOT escape sequences like \n
MCP/JSON will handle the encoding automatically
Incorrect: {"content": "line1\nline2"} - this writes literal \n characters
Correct: Use actual line breaks in your JSON string value
Only works within allowed directories.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| content | Yes | File content to write. For multi-line content, use actual newlines in the string value, not escape sequences like \n. Example: 'line1\nline2' should be formatted as an actual multi-line string in JSON. |