write_file
Create new text files or overwrite existing ones entirely, writing UTF-8 content byte-for-byte. Automatically creates missing parent directories and only overwrites when explicitly enabled to prevent accidental data loss.
Instructions
Create a text file, or replace one entirely.
Refuses to overwrite an existing file unless overwrite is true. That
default is deliberate: use edit_file to change part of a file, and reserve
this tool for creating new ones. Rewriting a whole file to change three
lines is how a small model accidentally deletes the rest of it.
Writes are confined to the download root plus any directory listed in BIONIC_PROJECT_ROOTS. Missing parent directories are created.
Newlines are written exactly as given, with no CRLF translation, so the content lands byte-for-byte as supplied. Encoding is always UTF-8.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| content | Yes | ||
| overwrite | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |