add_import
Add import statements to files without creating duplicates. Automatically inserts after the last existing import.
Instructions
Add an import statement to a file. Automatically checks for duplicates and inserts after the last existing import.
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": "<file>",
"import_statement": "<import_statement>"
},
"name": "add_import"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Relative file path | |
| import_statement | Yes | Full import statement to add (e.g. "import { useState } from 'react'") |