Write or Create File
fs_write_fileCreate a new file or overwrite/append existing file content, with optional encoding, permissions, and automatic parent directory creation.
Instructions
创建新文件,或覆盖/追加修改已有文件内容。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"content": "<content>"
},
"name": "fs_write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 可选文件权限(八进制字符串,如 "644" 或 "755") | |
| path | Yes | 目标文件路径 | |
| append | No | 是否追加到文件末尾(默认覆盖) | |
| content | Yes | 写入的文件内容 | |
| encoding | No | 内容编码 | utf8 |
| createDirs | No | 父目录不存在时是否自动创建 |