Edit build script
edit_scriptEdit a saved script and re-run it, updating the SAME gallery build. Use for every refinement instead of rewriting. Redo a section by line range (numbers from read_script). {search, replace} is for small changes; search must exist verbatim — to ADD code, search an existing anchor line and put anchor + new code in replace. edits:[] just re-runs (new params/volume). Volume and origin are inherited; expandMargin grows them.
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": {
"scriptId": "<scriptId>",
"edits": "<edits>"
},
"name": "edit_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Gallery title. | |
| tags | No | ||
| depth | No | ||
| edits | Yes | Each is {search, replace} OR {startLine, endLine, replace}. | |
| model | No | Your model id. | |
| width | No | ||
| height | No | ||
| params | No | param() values. Omitted = the saved ones (gallery sliders); {} = defaults. | |
| originX | No | ||
| originY | No | ||
| originZ | No | ||
| renders | No | As in execute_script; [] = none. Keep few. | |
| timeout | No | ms (default 30000). | |
| scriptId | Yes | From execute_script. | |
| unlisted | No | ||
| editPrompt | No | EVERY edit: why — the user's own words when given ("roof too flat"), else your reason. Saved as failure→fix data. | |
| showImages | No | false: render URLs only. | |
| userPrompt | No | ||
| baseBuildId | No | Omit to keep the current base build; "" drops it. | |
| checkParams | No | As in execute_script. | |
| expandMargin | No | N blocks of room on every side (volume +2N, origin +N): fixes clipping at any edge. | |
| enhancedPrompt | No |