write_file
Create new files or fully overwrite existing ones, building parent folders as needed. Use apply_patch or edit_file for changes to existing files.
Instructions
Create or fully overwrite a file (parent folders are created). Prefer apply_patch/edit_file for changes to existing files.
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": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path | |
| check | No | Run compilers/linters on the changed files afterwards (default true) | |
| content | Yes | Complete new file content | |
| expectedSha256 | No | Optional optimistic precondition from file_info; refuse overwrite if the file changed |