format_range
Apply fonts, colors, alignment, borders, number formats, widths, freeze panes, merges, filters and validation to Excel/CSV ranges in one call to make sheets readable and consistent.
Instructions
Make sheets look good: fonts, fills, number formats, alignment, borders, widths, freeze panes, merge, filters, conditional formatting and dropdown validation. Combine several options in one 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>"
},
"name": "format_range"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bold | No | ||
| path | Yes | File path, relative to the root folder (or absolute inside it). | |
| merge | No | true = merge range, false = unmerge. | |
| range | No | Cells to format, e.g. 'A1:F1' or 'C:C'. | |
| sheet | No | Sheet name (or 0-based index). Default: first sheet. | |
| border | No | Border on every cell. | |
| italic | No | ||
| autofit | No | Auto-size columns in range to their content. | |
| dry_run | No | Preview the change without saving. | |
| h_align | No | Horizontal alignment. | |
| v_align | No | Vertical alignment. | |
| font_name | No | ||
| font_size | No | ||
| underline | No | ||
| wrap_text | No | ||
| fill_color | No | Background: hex or name (lightyellow, lightgreen, ...); 'none' clears. | |
| font_color | No | Hex '#RRGGBB' or name (red, darkblue, ...). | |
| row_height | No | ||
| validation | No | Data validation: {'type':'list','values':['Yes','No']} (dropdown) or {'type':'whole','min':0,'max':100}. | |
| auto_filter | No | Add (true) or remove (false) filter dropdowns on the range. | |
| conditional | No | Conditional formatting: {'type':'color_scale'} | {'type':'data_bar','color':'#638EC6'} | {'type':'icon_set'} | {'type':'cell_is','operator':'>','values':[100],'fill_color':'lightgreen'} | {'type':'formula','formula':'$D2<0','fill_color':'lightred'} | {'type':'duplicates'} | |
| border_color | No | ||
| column_width | No | Width for columns in range, or {'A': 30, 'B': 12}. | |
| freeze_panes | No | Freeze above/left of this cell, e.g. 'A2' (header row) or 'B2'; 'none' unfreezes. | |
| number_format | No | Preset (currency, usd, eur, bdt, percent, integer, decimal, date, datetime, text) or Excel code like '#,##0.0'. |