Write File
write_fileCreate or fully replace a single file in a Google Apps Script project while keeping other files intact. Specify the file name without extension and choose JS, HTML, or JSON type.
Instructions
Create or fully replace one file in a project; other files are kept.
name has no extension ("Code", not "Code.gs"). type defaults to
SERVER_JS, or JSON for the "appsscript" manifest; use HTML for HtmlService
templates.
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": {
"script_id": "<script_id>",
"name": "<name>",
"source": "<source>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| type | No | ||
| source | Yes | ||
| script_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||