insert_text
Insert or replace text at specific line ranges in files for precise code editing without context-heavy operations.
Instructions
Insert or replace text at precise line ranges in files
Ideal for direct line-number operations (from code citations like 12:15:file.ts) and large files where context-heavy editing is inefficient.
TIP: Combine with read_symbol (must use optimize: false!) to edit any symbol anywhere without knowing its file or line range!
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": {
"file_path": "<file_path>",
"from_line": "<from_line>",
"text": "<text>"
},
"name": "insert_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to the file | |
| from_line | Yes | Starting line number (1-based) | |
| text | Yes | Text to insert | |
| to_line | No | Replace up to this line number (1-based, inclusive). If omitted only inserts |