writeFile
Create or overwrite files with text content. Use to save generated code, update configuration, or persist data as UTF-8 text. Parent directories must already exist.
Instructions
Write text content to a file, creating it if it does not exist or overwriting it if it does. The file is written atomically as UTF-8. Use this to create new files, update configuration, save generated code, or persist any text data. Parent directories must already exist. Returns a confirmation message with the resolved file path on success. Paths targeting sensitive system directories (e.g. /etc/shadow, /proc/, /dev/) are blocked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute or relative path to the file to write. Relative paths are resolved from the server's working directory. Must not be empty or contain null bytes. Examples: `/tmp/output.txt`, `./results.json`. | |
| content | Yes | The full text content to write to the file. This completely replaces any existing file content. Can be an empty string to create/truncate a file. |