write_file
Create a new file or replace/append content to an existing file in the repository. Handles whole-file writes and creates parent directories; use edit_file for targeted edits.
Instructions
Create a new file, or replace / append to an existing one. Use this for NEW files. To change part of an existing file use edit_file instead — it is safer and much cheaper than resending the whole file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | create (default, fails if the file exists), overwrite, or append. | |
| path | Yes | File path relative to the workspace root. Parent directories are created. | |
| content | Yes | Full file content (or the text to append). | |
| workspace | No | Workspace alias. Defaults to the active workspace. |