fmt
Reflows paragraphs to a specified character width while preserving blank-line separated paragraph boundaries. Returns reformatted text as JSON (or plain with --raw) for prose reformatting without breaking paragraph structure.
Instructions
Reflow paragraphs to a target character width, preserving paragraph boundaries (blank-line separated). Read-only, no side effects. Returns JSON with reflowed text by default; use --raw for plain output. Use to reformat prose without breaking paragraph structure. Not for hard line wrapping — use 'fold' to break at exact character positions without paragraph awareness. See also 'fold'.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "fmt"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write formatted text without a JSON envelope. | |
| paths | No | Files to format, or '-' for stdin. Defaults to stdin. | |
| width | No | Maximum output line width. | |
| encoding | No | Text encoding (default: utf-8). Use 'auto' for BOM/autodetection. | utf-8 |
| max_lines | No | Maximum JSON lines to emit. | |
| show_encoding | No | Include encoding detection metadata in JSON result. | |
| encoding_errors | No | How to handle encoding errors (default: replace). | replace |
| encoding_profile | No | Locale-aware encoding fallback profile for auto-detection. |