insert_script_lines
Insert new lines into a Roblox script at a specific position using line numbers from the script's numbered source to ensure precise placement.
Instructions
Insert new lines into a Roblox script at a specific position. IMPORTANT: Use the "numberedSource" field from get_script_source to identify the correct line numbers.
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>",
"newContent": "<newContent>"
},
"name": "insert_script_lines"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| afterLine | No | Insert after this line number (0 = insert at very beginning, 1 = after first line). Get line numbers from "numberedSource". | |
| newContent | Yes | Content to insert (can be multiple lines separated by newlines) | |
| instancePath | Yes | Roblox instance path to the script (e.g., "game.ServerScriptService.MainScript") |