Update project files
update_project_filesEDIT a deployed site — call get_project_files first, never edit from memory. PREFERRED: targeted edits ({ path, oldString, newString }) — you send only the changed text, and the server verifies oldString against the ACTUAL live file (exactly one match required), so a stale copy can never overwrite anything. Use files (full content) only for rewrites or new files, deletePaths for removals. Every file you do NOT name is guaranteed untouched — deletions never happen by omission. All-or-nothing: any failed match or invalid path rejects the whole patch with nothing changed. Text files only (HTML/CSS/JS) — images live in the Media Library. Single-file projects accept edits to their one file (path "/"); adding/deleting files is multi-file only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | No | PREFERRED for changes: find-and-replace verified against the live file — costs only the changed text, never the whole file | |
| files | No | Full-content replacement — ONLY for complete rewrites or brand-new files; use edits for changes | |
| projectId | Yes | The project ID (from list_projects or get_project) | |
| deletePaths | No | Paths to remove from the site (multi-file projects only). The entry page can never be deleted. |