applyCodeAction
Apply a specific code action to a selected range in a file. Use getCodeActions first to obtain available actions.
Instructions
Apply code action by title. Use getCodeActions first to see options.
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": {
"filePath": "<filePath>",
"startLine": "<startLine>",
"startColumn": "<startColumn>",
"endLine": "<endLine>",
"endColumn": "<endColumn>",
"actionTitle": "<actionTitle>"
},
"name": "applyCodeAction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endLine | Yes | End line (1-based) | |
| filePath | Yes | Workspace or absolute path | |
| endColumn | Yes | End column (1-based) | |
| startLine | Yes | Start line (1-based) | |
| actionTitle | Yes | Exact action title from getCodeActions output | |
| startColumn | Yes | Start column (1-based) |