agent_write_file
Write text content to files, optionally appending and auto-creating parent directories.
Instructions
Write text content to a file, optionally creating parent directories.
Args: path: Absolute or relative path to the file. content: Text content to write. encoding: Text encoding to use. append: If True, append to the file instead of overwriting. create_dirs: If True, create parent directories when they do not exist.
Returns: str: JSON string with keys 'success', 'path', 'bytes_written', and 'operation' ('append' or 'overwrite').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute or relative path to the file to write. | |
| append | No | If True, append to the file instead of overwriting. | |
| content | Yes | Text content to write to the file. | |
| encoding | No | Text encoding to use when writing the file. | utf-8 |
| create_dirs | No | If True, create parent directories when they do not exist. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |