refactor_extract_function
Extracts a selected code block into a new function, detects required parameters, and generates the function call to preserve behavior.
Instructions
Extract a block of code into a new function. Detects parameters and generates function call.
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": {
"path": "<path>",
"filePath": "<filePath>",
"startLine": "<startLine>",
"endLine": "<endLine>",
"functionName": "<functionName>"
},
"name": "refactor_extract_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Root path of the repository | |
| apply | No | Apply changes (default: false) | |
| endLine | Yes | Ending line of code to extract | |
| filePath | Yes | Path to the file | |
| startLine | Yes | Starting line of code to extract | |
| functionName | Yes | Name for the new function |