Skip to main content
Glama

format_cells

Apply font, fill, alignment, borders, and number formats to a specified cell range in an Excel sheet. Control style attributes individually or with presets while preserving existing formatting.

Instructions

Apply font, fill, alignment, borders and number formats to a cell range.

Args: file_path, sheet_name: Target workbook and sheet. cell_range: Range to format. bold, italic, font_size, font_color, bg_color: Font and fill controls. number_format: Custom number format string. horizontal_alignment, vertical_alignment: Alignment enums. wrap_text, border_style, border_color, font_name, underline, strikethrough, text_rotation, indent, shrink_to_fit: Formatting options. top_border_style, bottom_border_style, left_border_style, right_border_style: Per-side border overrides. number_format_preset: Named preset from NUMBER_FORMAT_PRESETS. preserve_existing: If True, do not overwrite unspecified style attributes.

Returns: str: Result message.

Notes: - Mutates formatting in workbook; recommend documenting idempotency when called multiple times with same args.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boldNo
indentNo
italicNo
bg_colorNo
file_pathYes
font_nameNo
font_sizeNo
underlineNo
wrap_textNo
cell_rangeYes
font_colorNo
sheet_nameYes
border_colorNo
border_styleNo
number_formatNo
shrink_to_fitNo
strikethroughNo
text_rotationNo
top_border_styleNo
left_border_styleNo
preserve_existingNo
right_border_styleNo
vertical_alignmentNo
bottom_border_styleNo
horizontal_alignmentNo
number_format_presetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Since no annotations are provided, the description carries the full burden. It explicitly states 'Mutates formatting in workbook' and adds an idempotency warning. It also explains the preserve_existing behavior, which is a key nuance. However, it does not mention permissions, error conditions, or file-saving behavior, so it is not fully exhaustive.

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

Conciseness5/5

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

The description is well-structured into Args, Returns, and Notes sections. The opening sentence states the core purpose, and every line adds value by cataloging parameters or behavior. Despite covering 26 parameters, it remains readable and free of fluff.

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

Completeness4/5

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

Given the high parameter count and no annotations, the description covers the full parameter set, return type, and mutation behavior. It is missing an explicit explanation of what happens when preserve_existing is False (whether unspecified styles are reset to defaults), which is a notable gap, but overall it provides enough context for correct use.

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?

With schema description coverage at 0%, the description compensates well by listing and grouping all 26 parameters into meaningful categories (e.g., 'Font and fill controls', 'Alignment enums', 'Per-side border overrides') and explains preserve_existing. Some parameters like wrap_text are only listed, but the names and grouping provide adequate semantic clarity.

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 opens with a specific verb 'Apply' and lists concrete resources: 'font, fill, alignment, borders and number formats to a cell range'. This clearly distinguishes it from siblings like copy_cell_format or clear_cell_format, which perform different actions on formatting.

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

Usage Guidelines3/5

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

The description implies when to use the tool (when formatting a range), but it does not explicitly state situations to avoid or mention alternatives. No exclusions or comparative guidance are provided, so the usage context is only implied.

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/mbeps/excel-mcp'

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