edit_script_lines
Replace specific lines in a Roblox script using instance path, line range, and new content. Avoid rewriting the entire source.
Instructions
Replace specific lines in a Roblox script without rewriting the entire source. IMPORTANT: Use the "numberedSource" field from get_script_source to identify the correct line numbers. Lines are 1-indexed and ranges are inclusive.
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>",
"startLine": "<startLine>",
"endLine": "<endLine>",
"newContent": "<newContent>"
},
"name": "edit_script_lines"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endLine | Yes | Last line to replace (inclusive). Get this from the "numberedSource" field. | |
| startLine | Yes | First line to replace (1-indexed). Get this from the "numberedSource" field. | |
| newContent | Yes | New content to replace the specified lines (can be multiple lines separated by newlines) | |
| instancePath | Yes | Roblox instance path to the script (e.g., "game.ServerScriptService.MainScript") |