write_file
Create, overwrite, or append to files in VS Code and save changes to disk while preserving Undo history on open tabs.
Instructions
Create a new file with the given contents, overwrite an existing file, or append when Append is true. Automatically saves to disk in VS Code while preserving Undo history on open tabs.
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 | The absolute path of the file to create or write. | |
| Append | No | Whether to append Content to the end of the file. Cannot be combined with Overwrite=true. | |
| Content | Yes | The full contents to write to the file. | |
| Overwrite | No | Whether to overwrite an existing file, replacing its entire contents. |