Edit script text
edit_scriptApply exact literal string replacements inside a Roblox Studio script, failing safely when the target text is missing to prevent silent corruption.
Instructions
Apply an exact literal string replacement inside a script. Fails if find is missing, so a bad edit cannot silently corrupt the file. Set all=true to replace every occurrence, otherwise the occurrence must be unique unless occurrence (1-based) is given.
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": {
"path": "<path>",
"find": "<find>",
"replace": "<replace>"
},
"name": "edit_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Replace every occurrence. Default false. | |
| find | Yes | Exact literal text to find (not a pattern). | |
| path | Yes | Instance path. Accepts "Workspace.Model.Part", "game.Workspace.Model.Part" or "game.Workspace[\"My Part\"].Model". Use "game" or omit for the DataModel root. | |
| replace | Yes | Replacement text. | |
| occurrence | No | Which 1-based occurrence to replace when all=false. |