Skip to main content
Glama

Format range

format_range

Apply font, fill, border, alignment, number format, and protection settings to an Excel range, including locked and formula-hidden options for protected sheets.

Instructions

Change the font, fill, borders, alignment, number format or protection flags of a range. locked and formula_hidden apply once the sheet is protected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
rangeYes
sheetYes
styleYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed86 schema fields changedv2.0.0
    • removedInput schema / $defs / CellFormat / description
      Removed value: -"Formatting to apply. Fields left as null keep the cell's current setting."
    • removedInput schema / $defs / CellFormat / properties / bold / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / bold / default
      Removed value: -null
    • removedInput schema / $defs / CellFormat / properties / bold / description
      Removed value: -"Bold text."
    • removedInput schema / $defs / CellFormat / properties / bold / title
      Removed value: -"Bold"
    • addedInput schema / $defs / CellFormat / properties / bold / type
      Added value: +"boolean"
    • removedInput schema / $defs / CellFormat / properties / border_color / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / border_color / default
      Removed value: -null
    • changedInput schema / $defs / CellFormat / properties / border_color / description
      Previous value: -"Border hex color (default black)."New value: +"Hex. Default: black."
    • removedInput schema / $defs / CellFormat / properties / border_color / title
      Removed value: -"Border Color"
    • addedInput schema / $defs / CellFormat / properties / border_color / type
      Added value: +"string"
    • removedInput schema / $defs / CellFormat / properties / border_style / anyOf
      Removed value: -[
      -  {
      -    "enum": [
      -      "none",
      -      "thin",
      -      "medium",
      -      "thick",
      -      "double",
      -      "dashed",
      -      "dotted"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / border_style / default
      Removed value: -null
    • changedInput schema / $defs / CellFormat / properties / border_style / description
      Previous value: -"Border on all four sides of every cell; 'none' removes it."New value: +"All four sides of every cell."
    • addedInput schema / $defs / CellFormat / properties / border_style / enum
      Added value: +[
      +  "none",
      +  "thin",
      +  "medium",
      +  "thick",
      +  "double",
      +  "dashed",
      +  "dotted"
      +]
    • removedInput schema / $defs / CellFormat / properties / border_style / title
      Removed value: -"Border Style"
    • addedInput schema / $defs / CellFormat / properties / border_style / type
      Added value: +"string"
    • removedInput schema / $defs / CellFormat / properties / fill_color / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / fill_color / default
      Removed value: -null
    • changedInput schema / $defs / CellFormat / properties / fill_color / description
      Previous value: -"Background hex color."New value: +"Hex."
    • removedInput schema / $defs / CellFormat / properties / fill_color / title
      Removed value: -"Fill Color"
    • addedInput schema / $defs / CellFormat / properties / fill_color / type
      Added value: +"string"
    • removedInput schema / $defs / CellFormat / properties / font_color / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / font_color / default
      Removed value: -null
    • changedInput schema / $defs / CellFormat / properties / font_color / description
      Previous value: -"Hex color, e.g. '#1F4E78'."New value: +"Hex, e.g. '#1F4E78'."
    • removedInput schema / $defs / CellFormat / properties / font_color / title
      Removed value: -"Font Color"
    • addedInput schema / $defs / CellFormat / properties / font_color / type
      Added value: +"string"
    • removedInput schema / $defs / CellFormat / properties / font_name / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / font_name / default
      Removed value: -null
    • changedInput schema / $defs / CellFormat / properties / font_name / description
      Previous value: -"Font family, e.g. 'Calibri'."New value: +"e.g. 'Calibri'."
    • removedInput schema / $defs / CellFormat / properties / font_name / title
      Removed value: -"Font Name"
    • addedInput schema / $defs / CellFormat / properties / font_name / type
      Added value: +"string"
    • removedInput schema / $defs / CellFormat / properties / font_size / anyOf
      Removed value: -[
      -  {
      -    "exclusiveMinimum": 0,
      -    "maximum": 409,
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / font_size / default
      Removed value: -null
    • changedInput schema / $defs / CellFormat / properties / font_size / description
      Previous value: -"Size in points."New value: +"Points."
    • addedInput schema / $defs / CellFormat / properties / font_size / maximum
      Added value: +409
    • removedInput schema / $defs / CellFormat / properties / font_size / title
      Removed value: -"Font Size"
    • addedInput schema / $defs / CellFormat / properties / font_size / type
      Added value: +"number"
    • addedInput schema / $defs / CellFormat / properties / formula_hidden
      Added value: +{
      +  "description": "Hide the formula on a protected sheet.",
      +  "type": "boolean"
      +}
    • removedInput schema / $defs / CellFormat / properties / horizontal_alignment / anyOf
      Removed value: -[
      -  {
      -    "enum": [
      -      "general",
      -      "left",
      -      "center",
      -      "right",
      -      "fill",
      -      "justify"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / horizontal_alignment / default
      Removed value: -null
    • removedInput schema / $defs / CellFormat / properties / horizontal_alignment / description
      Removed value: -"Horizontal text alignment."
    • addedInput schema / $defs / CellFormat / properties / horizontal_alignment / enum
      Added value: +[
      +  "general",
      +  "left",
      +  "center",
      +  "right",
      +  "fill",
      +  "justify"
      +]
    • removedInput schema / $defs / CellFormat / properties / horizontal_alignment / title
      Removed value: -"Horizontal Alignment"
    • addedInput schema / $defs / CellFormat / properties / horizontal_alignment / type
      Added value: +"string"
    • removedInput schema / $defs / CellFormat / properties / italic / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / italic / default
      Removed value: -null
    • removedInput schema / $defs / CellFormat / properties / italic / description
      Removed value: -"Italic text."
    • removedInput schema / $defs / CellFormat / properties / italic / title
      Removed value: -"Italic"
    • addedInput schema / $defs / CellFormat / properties / italic / type
      Added value: +"boolean"
    • addedInput schema / $defs / CellFormat / properties / locked
      Added value: +{
      +  "description": "Default on: locked cells cannot be edited on a protected sheet.",
      +  "type": "boolean"
      +}
    • removedInput schema / $defs / CellFormat / properties / number_format / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / number_format / default
      Removed value: -null
    • changedInput schema / $defs / CellFormat / properties / number_format / description
      Previous value: -"Excel number format, e.g. '#,##0.00', '0%', '@'."New value: +"Excel code: '#,##0.00', '0%', 'yyyy-mm-dd', '@' (text)."
    • removedInput schema / $defs / CellFormat / properties / number_format / title
      Removed value: -"Number Format"
    • addedInput schema / $defs / CellFormat / properties / number_format / type
      Added value: +"string"
    • removedInput schema / $defs / CellFormat / properties / strikethrough / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / strikethrough / default
      Removed value: -null
    • removedInput schema / $defs / CellFormat / properties / strikethrough / description
      Removed value: -"Strike through text."
    • removedInput schema / $defs / CellFormat / properties / strikethrough / title
      Removed value: -"Strikethrough"
    • addedInput schema / $defs / CellFormat / properties / strikethrough / type
      Added value: +"boolean"
    • removedInput schema / $defs / CellFormat / properties / underline / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / underline / default
      Removed value: -null
    • removedInput schema / $defs / CellFormat / properties / underline / description
      Removed value: -"Single underline."
    • removedInput schema / $defs / CellFormat / properties / underline / title
      Removed value: -"Underline"
    • addedInput schema / $defs / CellFormat / properties / underline / type
      Added value: +"boolean"
    • removedInput schema / $defs / CellFormat / properties / vertical_alignment / anyOf
      Removed value: -[
      -  {
      -    "enum": [
      -      "top",
      -      "center",
      -      "bottom",
      -      "justify"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / vertical_alignment / default
      Removed value: -null
    • removedInput schema / $defs / CellFormat / properties / vertical_alignment / description
      Removed value: -"Vertical text alignment."
    • addedInput schema / $defs / CellFormat / properties / vertical_alignment / enum
      Added value: +[
      +  "top",
      +  "center",
      +  "bottom",
      +  "justify"
      +]
    • removedInput schema / $defs / CellFormat / properties / vertical_alignment / title
      Removed value: -"Vertical Alignment"
    • addedInput schema / $defs / CellFormat / properties / vertical_alignment / type
      Added value: +"string"
    • removedInput schema / $defs / CellFormat / properties / wrap_text / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / CellFormat / properties / wrap_text / default
      Removed value: -null
    • removedInput schema / $defs / CellFormat / properties / wrap_text / description
      Removed value: -"Wrap long text onto new lines."
    • removedInput schema / $defs / CellFormat / properties / wrap_text / title
      Removed value: -"Wrap Text"
    • addedInput schema / $defs / CellFormat / properties / wrap_text / type
      Added value: +"boolean"
    • removedInput schema / $defs / CellFormat / title
      Removed value: -"CellFormat"
    • removedInput schema / properties / path / description
      Removed value: -"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."
    • removedInput schema / properties / path / title
      Removed value: -"Path"
    • removedInput schema / properties / range / description
      Removed value: -"A cell or rectangular range in A1 notation, e.g. 'A1:D20'."
    • removedInput schema / properties / range / title
      Removed value: -"Range"
    • removedInput schema / properties / sheet / description
      Removed value: -"Worksheet name, e.g. 'Sheet1'."
    • removedInput schema / properties / sheet / title
      Removed value: -"Sheet"
    • removedInput schema / title
      Removed value: -"format_rangeArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "format_rangeOutput",
      -  "type": "object"
      -}New value: +null
  2. 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"
      +]
  3. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare the mutation profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), so the bar is lower. The description usefully adds the caveat that `locked` and `formula_hidden` only take effect once the sheet is protected, but it doesn't state whether a partial `style` preserves or resets existing formatting, nor any permission requirements.

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?

Two tight sentences with the core action front-loaded and the one non-obvious caveat appended. No filler, nothing to trim.

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?

For a mutation tool with no output schema and only minimal annotations, the description covers the what and one important interaction with sheet protection. It is still missing the key question of merge-vs-replace semantics for the style object and any error/edge behavior, so it is adequate rather than complete.

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?

Top-level parameters (path, sheet, range, style) carry no descriptions, though many nested CellFormat fields do. The description groups the styling options into categories (font, fill, borders, alignment, number format, protection), giving marginal help in navigating the nested style object, but adds no syntax, format, or range-addressing detail.

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?

Names a specific verb (Change) and resource (a range), then enumerates exactly which visual/protection attributes it can alter: font, fill, borders, alignment, number format, protection flags. That enumeration implicitly separates it from write_range and transform_range, but no sibling is named explicitly, so it falls short of a 5.

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 at all: nothing says how this differs from write_range, transform_range, set_sheet_layout, or add_conditional_format, all of which touch range appearance/content. The protection caveat is a behavioral detail, not routing guidance.

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