write_file
Update existing files by writing new content that replaces the old version. Read the file first, then modify and save; for new files, use create_file instead.
Instructions
WRITE OR UPDATE content to existing file, completely replacing current content. Workflow: read file first, modify content, then write back. For new files use 'create_file'. Keywords: write, update, modify, save, edit file, change file. / 写入或更新现有文件内容,完全替换当前内容。工作流程:先读取文件,修改内容,然后写回。新文件请使用 'create_file'。关键词:写入、更新、修改、保存、编辑文件。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The file path to write to. The file should already exist (use 'create_file' for new files). Can be absolute or relative path. Examples: 'src/main.go' (update source code), 'config.yaml' (update configuration), 'index.html' (update web page). | |
| content | Yes | The new content to write to the file. This will completely replace the existing content. Make sure to include all content you want to keep, as the old content will be lost. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | ||
| success | Yes |