Write file
write_fileCreates or overwrites a file with the full content. Prefer edit_file for changes to existing files. Keep each write short (under about 150 lines): build a long page one section at a time, each section its own file placed in the page with a small edit_file, say one line to the user before each write, and change existing files with small edit_file replacements rather than rewriting them. A reply that is cut off loses only the step it was on: read what is saved and carry on (skill site-builder). Pass base (the version read_file gave) when overwriting a file you read, or null for a file that must not exist yet: if the file changed meanwhile, the write is refused with file_changed, so read it again and redo the change.
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": {
"projectId": "<projectId>",
"path": "<path>",
"content": "<content>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | The file's version from read_file, or null for a new file that must not exist yet. Optional | |
| path | Yes | ||
| content | Yes | ||
| projectId | Yes | Project id from list_projects |