format_document
Format TypeScript or JavaScript files with TypeScript's built-in formatter and write the result to disk. Optionally retrieve the formatted text.
Instructions
Format a TypeScript/JavaScript file using TypeScript's built-in formatter and write the result to disk. Pass includeContent to also get the formatted text back.
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>"
},
"name": "format_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path to the file (relative to project root) | |
| options | No | Formatting options (all optional) | |
| includeContent | No | Return the full formatted text as well (default: false). The file is written to disk either way. |