write_file
Write or append text content to a file, automatically creating parent directories if needed, within allowed directories.
Instructions
Write or append text content to a file.
The parent directory is created automatically if it doesn't exist. The path must be inside an allowed directory and the extension must not be in the blocked list.
Returns a success message with the number of lines written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the file to write. | |
| content | Yes | Text content to write to the file. | |
| mode | No | Write mode: 'rewrite' (default) overwrites; 'append' adds at end. | rewrite |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |