Skip to main content
Glama

Format range

format_range

Apply fonts, fills, borders, alignment, and number formats to an Excel cell range while keeping all unset formatting unchanged.

Instructions

Change fonts, fill, borders, alignment or number format of a range.

Only the fields you set change; everything else keeps its current formatting. Colors are hex, e.g. '#1F4E78'. Number formats use Excel codes such as '#,##0.00', '0%', 'yyyy-mm-dd' or '@' (text).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to an .xlsx, .xlsm, .xltx or .xltm file. Relative paths are resolved in the server's workbook directory when one is configured; otherwise use an absolute path.
rangeYesA cell or rectangular range in A1 notation, e.g. 'A1:D20'.
sheetYesWorksheet name, e.g. 'Sheet1'.
styleYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed24 schema fields changedv1.1.1
    • addedInput schema / $defs
      Added value: +{
      +  "CellFormat": {
      +    "description": "Formatting to apply. Fields left as null keep the cell's current setting.",
      +    "properties": {
      +      "bold": {
      +        "anyOf": [
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Bold text.",
      +        "title": "Bold"
      +      },
      +      "border_color": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Border hex color (default black).",
      +        "title": "Border Color"
      +      },
      +      "border_style": {
      +        "anyOf": [
      +          {
      +            "enum": [
      +              "none",
      +              "thin",
      +              "medium",
      +              "thick",
      +              "double",
      +              "dashed",
      +              "dotted"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Border on all four sides of every cell; 'none' removes it.",
      +        "title": "Border Style"
      +      },
      +      "fill_color": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Background hex color.",
      +        "title": "Fill Color"
      +      },
      +      "font_color": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Hex color, e.g. '#1F4E78'.",
      +        "title": "Font Color"
      +      },
      +      "font_name": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Font family, e.g. 'Calibri'.",
      +        "title": "Font Name"
      +      },
      +      "font_size": {
      +        "anyOf": [
      +          {
      +            "exclusiveMinimum": 0,
      +            "maximum": 409,
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Size in points.",
      +        "title": "Font Size"
      +      },
      +      "horizontal_alignment": {
      +        "anyOf": [
      +          {
      +            "enum": [
      +              "general",
      +              "left",
      +              "center",
      +              "right",
      +              "fill",
      +              "justify"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Horizontal text alignment.",
      +        "title": "Horizontal Alignment"
      +      },
      +      "italic": {
      +        "anyOf": [
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Italic text.",
      +        "title": "Italic"
      +      },
      +      "number_format": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Excel number format, e.g. '#,##0.00', '0%', '@'.",
      +        "title": "Number Format"
      +      },
      +      "strikethrough": {
      +        "anyOf": [
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Strike through text.",
      +        "title": "Strikethrough"
      +      },
      +      "underline": {
      +        "anyOf": [
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Single underline.",
      +        "title": "Underline"
      +      },
      +      "vertical_alignment": {
      +        "anyOf": [
      +          {
      +            "enum": [
      +              "top",
      +              "center",
      +              "bottom",
      +              "justify"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Vertical text alignment.",
      +        "title": "Vertical Alignment"
      +      },
      +      "wrap_text": {
      +        "anyOf": [
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Wrap long text onto new lines.",
      +        "title": "Wrap Text"
      +      }
      +    },
      +    "title": "CellFormat",
      +    "type": "object"
      +  }
      +}
    • removedInput schema / properties / alignment
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Alignment"
      -}
    • removedInput schema / properties / bg_color
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Bg Color"
      -}
    • removedInput schema / properties / bold
      Removed value: -{
      -  "default": false,
      -  "title": "Bold",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / border_color
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Border Color"
      -}
    • removedInput schema / properties / border_style
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Border Style"
      -}
    • removedInput schema / properties / conditional_format
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Conditional Format"
      -}
    • removedInput schema / properties / end_cell
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "End Cell"
      -}
    • removedInput schema / properties / filepath
      Removed value: -{
      -  "title": "Filepath",
      -  "type": "string"
      -}
    • removedInput schema / properties / font_color
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Font Color"
      -}
    • removedInput schema / properties / font_size
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "integer"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Font Size"
      -}
    • removedInput schema / properties / italic
      Removed value: -{
      -  "default": false,
      -  "title": "Italic",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / merge_cells
      Removed value: -{
      -  "default": false,
      -  "title": "Merge Cells",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / number_format
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Number Format"
      -}
    • addedInput schema / properties / path
      Added value: +{
      +  "description": "Path to an .xlsx, .xlsm, .xltx or .xltm file. Relative paths are resolved in the server's workbook directory when one is configured; otherwise use an absolute path.",
      +  "title": "Path",
      +  "type": "string"
      +}
    • removedInput schema / properties / protection
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Protection"
      -}
    • addedInput schema / properties / range
      Added value: +{
      +  "description": "A cell or rectangular range in A1 notation, e.g. 'A1:D20'.",
      +  "title": "Range",
      +  "type": "string"
      +}
    • addedInput schema / properties / sheet
      Added value: +{
      +  "description": "Worksheet name, e.g. 'Sheet1'.",
      +  "title": "Sheet",
      +  "type": "string"
      +}
    • removedInput schema / properties / sheet_name
      Removed value: -{
      -  "title": "Sheet Name",
      -  "type": "string"
      -}
    • removedInput schema / properties / start_cell
      Removed value: -{
      -  "title": "Start Cell",
      -  "type": "string"
      -}
    • addedInput schema / properties / style
      Added value: +{
      +  "$ref": "#/$defs/CellFormat"
      +}
    • removedInput schema / properties / underline
      Removed value: -{
      -  "default": false,
      -  "title": "Underline",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / wrap_text
      Removed value: -{
      -  "default": false,
      -  "title": "Wrap Text",
      -  "type": "boolean"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "filepath",
      -  "sheet_name",
      -  "start_cell"
      -]New value: +[
      +  "path",
      +  "sheet",
      +  "range",
      +  "style"
      +]
  2. First observedv1.0.0

TDQS

A3.5/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, destructiveHint=false and openWorldHint=false, and the description adds genuinely useful merge semantics: 'Only the fields you set change; everything else keeps its current formatting.' That partial-update behavior is not derivable from the annotations and is the key thing an agent needs to avoid clobbering existing styles.

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

Conciseness4/5

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

Four short sentences, purpose front-loaded, with the constraint sentence second and format conventions after. Tight overall, though the color/number-format sentences partially duplicate the schema descriptions and could be trimmed.

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?

An output schema exists, so return values need no explanation. Scope, partial-update behavior and value conventions are all covered; only minor operational details (e.g. behavior on invalid/merged ranges, file-must-exist requirement) are absent for a 4-required-param mutation tool.

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

Parameters3/5

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

Schema coverage is 75% and every CellFormat field already carries its own description, including hex-color and number-format examples, so the schema does most of the work. The description's hex and Excel-code guidance ('#,##0.00', '0%', 'yyyy-mm-dd', '@') largely repeats schema text, adding only marginal value; baseline 3 applies.

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

Purpose4/5

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

States a specific verb+resource ('Change fonts, fill, borders, alignment or number format of a range') and enumerates the formatting facets it touches. It implicitly separates itself from value-writing siblings like write_range, but never names an alternative tool, so an agent gets no explicit routing help among the many formatting-adjacent siblings.

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?

There is no when-to-use guidance and no named alternatives, even though obvious candidates exist (clear_range to strip formatting, add_conditional_format for rule-based styling, set_sheet_layout for sheet-wide defaults). Usage is only inferable from the purpose sentence.

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