Skip to main content
Glama

format_range

Apply formatting to a range of cells in an Excel worksheet. Supports bold, italic, colors, borders, number format, alignment, text wrapping, merge, protection, and conditional formatting.

Instructions

Apply formatting to a range of cells.

Args:
    sheet_name: Name of worksheet
    start_cell: Starting cell
    session_id: Session ID from open_workbook (preferred)
    filepath: Path to Excel file (legacy, deprecated)
    end_cell: Ending cell (optional)
    bold: Apply bold formatting
    italic: Apply italic formatting
    underline: Apply underline formatting
    font_size: Font size
    font_color: Font color
    bg_color: Background color
    border_style: Border style
    border_color: Border color
    number_format: Number format
    alignment: Text alignment
    wrap_text: Enable text wrapping
    merge_cells: Merge cells in range
    protection: Cell protection settings (optional)
    conditional_format: Conditional formatting settings (optional)
    
Note: Use session_id for better performance. filepath parameter is deprecated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sheet_nameYes
start_cellYes
session_idNo
filepathNo
end_cellNo
boldNo
italicNo
underlineNo
font_sizeNo
font_colorNo
bg_colorNo
border_styleNo
border_colorNo
number_formatNo
alignmentNo
wrap_textNo
merge_cellsNo
protectionNo
conditional_formatNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears the full burden. It mentions applying formatting but does not disclose whether it overwrites existing formatting, whether the operation is reversible, or any side effects. For a tool with many parameters, more behavioral context is needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a clear purpose statement, but the bulk is a repetitive parameter list that largely mirrors the schema. The note at the end is concise. It could be more streamlined by grouping similar parameters, but it is not excessively verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (19 parameters, no annotations, but an output schema exists), the description covers all parameters and includes a useful deprecation note. However, it lacks guidance on when to use this tool versus siblings like merge_cells, and does not describe return values or behavioral impacts. It is adequate but not comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description's 'Args' section lists all 19 parameters with brief explanations (e.g., 'bold: Apply bold formatting'), adding semantics beyond the schema's property titles. The deprecation note for filepath is also helpful. However, some explanations are minimal (e.g., 'alignment: Text alignment' without allowed values).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Apply formatting to a range of cells', using a specific verb ('Apply formatting') and resource ('range'). This distinguishes it from siblings that perform other operations like deleting ranges or merging cells.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes a note advising to use 'session_id for better performance' and marks 'filepath' as deprecated, but it does not provide guidance on when to use this tool versus alternative formatting or range tools, such as merge_cells or delete_range.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fastmcp-me/xlwings-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server