Update project files
update_project_contentMerge or replace files in a Google Apps Script project. Merge upserts named files and can delete listed ones; replace makes the supplied files the entire project.
Instructions
Writes code files to the project's HEAD (deployed versions are untouched until you create a version + deployment). Two modes. mode="merge" (default, safer): the current content is read first, the given files are added or overwritten BY NAME, delete_files removes named files, everything else is preserved — not atomic, a concurrent edit between read and write is lost. mode="replace": the given files become the ENTIRE project; any file not in the list is deleted, and the list must include the "appsscript" manifest (type json) or the call is rejected before hitting the API. File names carry no extension ("Code", not "Code.gs"); the manifest cannot be deleted. Returns the resulting file set. This write is never retried after a 5xx or timeout — check with get_project_content before re-sending.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | merge (default): upsert the given files, keep the rest; replace: the given files become the whole project (manifest "appsscript" required). | |
| files | Yes | The files to write (merge: upserted by name; replace: the entire new file set). | |
| script_id | Yes | The script project id — from the Apps Script editor URL (script.google.com/home/projects/<scriptId>/edit) or from create_project output. For standalone projects it doubles as the Drive file id. | |
| delete_files | No | merge only: file names to remove (no extension). The "appsscript" manifest cannot be deleted. |