Format
formatApply consistent indentation, spacing, and line breaks to TypeScript code. Specify a range for targeted formatting or use the full file for complete formatting.
Instructions
Format a range of code according to TypeScript's formatting rules. Applies consistent indentation, spacing, and line breaks. Specify a range or use the full file length to format the entire file.
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>",
"line": "<line>",
"offset": "<offset>",
"endLine": "<endLine>",
"endOffset": "<endOffset>",
"preview": "<preview>"
},
"name": "format"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | File path (absolute or relative to cwd) | |
| line | Yes | Start line (1-based) | |
| offset | Yes | Start offset (1-based) | |
| endLine | Yes | End line (1-based) | |
| options | No | Formatting options | |
| preview | Yes | If true, return edits without applying | |
| endOffset | Yes | End offset (1-based) |