generate_code_to_file
Generate code and insert it into files at specific line numbers to modify existing codebases directly.
Instructions
Generate code and write it directly to a file at a specific line number
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": {
"description": "<description>",
"filePath": "<filePath>",
"lineNumber": "<lineNumber>"
},
"name": "generate_code_to_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Description of the code to generate | |
| language | No | Programming language (e.g., JavaScript, Python, TypeScript) | |
| additionalContext | No | Additional context or requirements for the code | |
| filePath | Yes | Path to the file where the code should be written | |
| lineNumber | Yes | Line number where the code should be inserted (0-based) | |
| replaceLines | No | Number of lines to replace (0 for insertion only) |