set_script_source
Replace the entire source code of a Roblox script at a given instance path. Works with open editors; use line editing tools for partial updates.
Instructions
Replace the entire source code of a Roblox script. Uses ScriptEditorService:UpdateSourceAsync (works with open editors). For partial edits, prefer edit_script_lines, insert_script_lines, or delete_script_lines.
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": {
"instancePath": "<instancePath>",
"source": "<source>"
},
"name": "set_script_source"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | New source code for the script | |
| instancePath | Yes | Roblox instance path to the script (e.g., "game.ServerScriptService.MainScript") |