Write many code files at once
sync_filesWrite many code files to a workspace in one all-or-nothing request, with SHA-256 integrity checks, optional local folder upload, and safe deletion of missing files.
Instructions
Writes MANY code files in ONE request — a whole site, from a list or straight from a folder on this machine (localDir; fonts and images are read as base64, hidden and build folders skipped). Use it instead of a write_file per file: one save, all or nothing, and every file carries a sha256 computed here that the server checks before storing anything, so a corrupted transfer stores none. Byte-identical files are reported unchanged and not rewritten. prefix puts local files under a workspace folder ("public" → public/index.html). deleteMissing removes workspace files the batch does not contain — only under prefix when one is given — and needs confirm:true.
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": {
"workspaceId": "<workspaceId>"
},
"name": "sync_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | Files to write. Omit when using localDir. | |
| prefix | No | Workspace folder the local files go under, e.g. "public" — also the only place deleteMissing may delete. | |
| confirm | No | Must be true when deleteMissing is true. Omit/false previews. | |
| localDir | No | A folder on THIS machine to upload as-is (fonts and images are read as base64). Omit when sending files. | |
| workspaceId | Yes | ||
| deleteMissing | No | Delete workspace files the batch does not contain (under prefix, if given). Needs confirm:true. |