sassy_write_file
Write files with full overwrite or append modes; preserves a backup snapshot before replacing existing content and creates missing folders automatically.
Instructions
Mutating: creates or overwrites files. mode defaults to 'rewrite' (full replace); on an existing file the prior contents are first snapshotted into the adjacent DELETE/ staging folder as stem.overwrite..ext, so overwrites are recoverable. mode 'append' adds bytes to the end. Missing parent directories are created. encoding defaults to utf-8 (any Python codec name); line_endings defaults to 'preserve' (verbatim), with 'lf' and 'crlf' normalizing all line breaks (crlf is useful for Windows .bat/.ps1 files). It bypasses the shell-keyword interceptor entirely, but protected paths (SassyMCP source tree, ~/.sassymcp, ~/.ssh, ~/.aws, etc.) are refused. Use it to create files or full rewrites; prefer sassy_edit_block or sassy_edit_multi for small changes to existing files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | rewrite | |
| path | Yes | ||
| content | Yes | ||
| encoding | No | utf-8 | |
| line_endings | No | preserve |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |