Skip to main content
Glama

excel_format_cells

Apply font, fill, border, alignment, and number formatting to a cell range in an Excel file. Each attribute can be set individually or left unchanged.

Instructions

Apply font, fill, border, alignment, and number-format to a range.

Each formatting argument is None by default and is treated as "do not change". When every formatting argument is None, the call is a true no-op: the file is not re-saved, so its SHA256 and mtime are preserved (VAL-EXCEL-049).

Args: path: Path to an existing .xlsx. sheet: Name of the sheet to format. cell_range: A cell reference ("A1") or a range ("A1:C3"). Column letters may be upper or lower case. bold: True / False to set font.bold, or None to leave it alone. italic: Same semantics as bold for font.italic. font_name: A font family name (e.g. "Arial"). font_size: Point size (e.g. 14). font_color: Hex RGB string ("FF0000"). fill_color: Hex RGB string for the cell background. border: Either a single style name applied to all four sides ("thin", "medium", "thick", "dashed", "dotted", "double", "hair") or a dict mapping "left" / "right" / "top" / "bottom" to a style name. alignment: "left" / "center" / "right" / "justify" / "general" for Alignment.horizontal. number_format: An Excel number format code (e.g. "0.00%", "#,##0.00", "yyyy-mm-dd"). folder: Optional base folder for relative paths.

Returns: {"ok": True}.

Raises: OfficeMCPError: ERR_FILE_NOT_FOUND if the file is missing, ERR_SHEET_NOT_FOUND for an unknown sheet, ERR_CELL_PARSE for a malformed range, ERR_INVALID_PARAMS for an unknown border style or alignment, ERR_UNSUPPORTED_FMT for non-.xlsx extensions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
sheetYes
cell_rangeYes
boldNo
italicNo
font_nameNo
font_sizeNo
font_colorNo
fill_colorNo
borderNo
alignmentNo
number_formatNo
folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Given no annotations, the description fully discloses behavior: None means 'do not change', all None leads to no-op preserving SHA256 and mtime, and lists possible errors. This is highly transparent.

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 with a clear header, numbered args with format, and separate sections for returns and raises. No unnecessary text; every sentence adds value.

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

Completeness5/5

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

Despite 13 parameters and complexity, the description covers all aspects: no-op behavior, each parameter's format, return value, and all error types. Output schema exists but description still provides return shape. Complete for an agent to use.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully explain each parameter. It does so with detail: border can be string or dict, alignment values, number_format examples, etc. Adds significant meaning beyond the schema's type and title.

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 the tool applies font, fill, border, alignment, and number-format to a range, which is distinct from sibling tools like excel_write_cell (which writes values) and excel_format_cells is the only formatting tool among siblings.

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

Usage Guidelines4/5

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

The description explains the behavior of None parameters and no-op case, but does not explicitly state when to use this tool vs. alternative tools like excel_write_cell or excel_write_range. However, the tool's purpose is self-evident given sibling names.

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/gawirable/office-mcp'

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