Skip to main content
Glama

Set sheet layout

set_sheet_layout

Configure Excel sheet layout: set column widths, row heights, freeze panes, auto filters, print setup, tab color and protection for consistent worksheet formatting.

Instructions

Set column widths, row heights, hidden or grouped lines, frozen panes, auto filter, tab color, visibility, position, view options, print setup and protection.

Protection discourages edits in Excel but is not security (it does not stop this server; the password is weakly hashed).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
sheetYes
layoutYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed52 schema fields changedv2.0.0
    • addedInput schema / $defs / AutoFilter
      Added value: +{
      +  "properties": {
      +    "filters": {
      +      "description": "Criteria; they replace earlier ones. A row must meet all.",
      +      "items": {
      +        "$ref": "#/$defs/FilterColumn"
      +      },
      +      "type": "array"
      +    },
      +    "range": {
      +      "description": "Header row and data, e.g. 'A1:F100', or the name of a table on the sheet.",
      +      "type": "string"
      +    },
      +    "remove": {
      +      "description": "Remove the filter and show its rows.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "range"
      +  ],
      +  "type": "object"
      +}
    • removedInput schema / $defs / ColumnWidth
      Removed value: -{
      -  "description": "The width of one column.",
      -  "properties": {
      -    "column": {
      -      "description": "Column letter, e.g. 'B'.",
      -      "title": "Column",
      -      "type": "string"
      -    },
      -    "width": {
      -      "description": "Width in characters.",
      -      "exclusiveMinimum": 0,
      -      "maximum": 255,
      -      "title": "Width",
      -      "type": "number"
      -    }
      -  },
      -  "required": [
      -    "column",
      -    "width"
      -  ],
      -  "title": "ColumnWidth",
      -  "type": "object"
      -}
    • addedInput schema / $defs / FilterColumn
      Added value: +{
      +  "properties": {
      +    "color": {
      +      "description": "color: fill color to show.",
      +      "type": "string"
      +    },
      +    "column": {
      +      "description": "Header text or column letter.",
      +      "type": "string"
      +    },
      +    "combine": {
      +      "default": "and",
      +      "description": "compare: 2 conditions.",
      +      "enum": [
      +        "and",
      +        "or"
      +      ],
      +      "type": "string"
      +    },
      +    "conditions": {
      +      "description": "compare.",
      +      "items": {
      +        "$ref": "#/$defs/FilterCondition"
      +      },
      +      "maxItems": 2,
      +      "minItems": 1,
      +      "type": "array"
      +    },
      +    "count": {
      +      "description": "top, bottom: items, or percent (1-100).",
      +      "maximum": 1000,
      +      "type": "integer"
      +    },
      +    "percent": {
      +      "description": "top, bottom.",
      +      "type": "boolean"
      +    },
      +    "type": {
      +      "enum": [
      +        "values",
      +        "compare",
      +        "top",
      +        "bottom",
      +        "above_average",
      +        "below_average",
      +        "color"
      +      ],
      +      "type": "string"
      +    },
      +    "values": {
      +      "description": "values: to show; '' is blank, dates '2026-01-31'. Formatted numbers need compare.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "column",
      +    "type"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / $defs / FilterCondition
      Added value: +{
      +  "properties": {
      +    "operator": {
      +      "enum": [
      +        "equals",
      +        "not_equals",
      +        "greater_than",
      +        "greater_or_equal",
      +        "less_than",
      +        "less_or_equal",
      +        "begins_with",
      +        "not_begins_with",
      +        "ends_with",
      +        "not_ends_with",
      +        "contains",
      +        "not_contains"
      +      ],
      +      "type": "string"
      +    },
      +    "value": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "number"
      +        }
      +      ],
      +      "description": "Text, number or date '2026-01-31'."
      +    }
      +  },
      +  "required": [
      +    "operator",
      +    "value"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / $defs / FitToPages
      Added value: +{
      +  "properties": {
      +    "tall": {
      +      "default": 1,
      +      "description": "0 = any number.",
      +      "maximum": 100,
      +      "type": "integer"
      +    },
      +    "wide": {
      +      "default": 1,
      +      "description": "0 = any number.",
      +      "maximum": 100,
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / $defs / HeaderFooterText
      Added value: +{
      +  "description": "'' clears a part.",
      +  "properties": {
      +    "center": {
      +      "type": "string"
      +    },
      +    "left": {
      +      "type": "string"
      +    },
      +    "right": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / $defs / LineAction
      Added value: +{
      +  "properties": {
      +    "action": {
      +      "description": "Group adds an outline level (max 7), ungroup removes one.",
      +      "enum": [
      +        "hide",
      +        "show",
      +        "group",
      +        "ungroup"
      +      ],
      +      "type": "string"
      +    },
      +    "span": {
      +      "description": "Rows '3' or '3:5'; columns 'B' or 'B:D'.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "span",
      +    "action"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / $defs / Margins
      Added value: +{
      +  "properties": {
      +    "bottom": {
      +      "maximum": 50,
      +      "type": "number"
      +    },
      +    "footer": {
      +      "maximum": 50,
      +      "type": "number"
      +    },
      +    "header": {
      +      "maximum": 50,
      +      "type": "number"
      +    },
      +    "left": {
      +      "maximum": 50,
      +      "type": "number"
      +    },
      +    "right": {
      +      "maximum": 50,
      +      "type": "number"
      +    },
      +    "top": {
      +      "maximum": 50,
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / $defs / PrintSetup
      Added value: +{
      +  "properties": {
      +    "center_horizontally": {
      +      "type": "boolean"
      +    },
      +    "center_vertically": {
      +      "type": "boolean"
      +    },
      +    "fit_to_pages": {
      +      "$ref": "#/$defs/FitToPages"
      +    },
      +    "footer": {
      +      "$ref": "#/$defs/HeaderFooterText"
      +    },
      +    "gridlines": {
      +      "type": "boolean"
      +    },
      +    "header": {
      +      "$ref": "#/$defs/HeaderFooterText",
      +      "description": "Codes: &P page, &N pages, &D date, &A sheet, &F file."
      +    },
      +    "margins_cm": {
      +      "$ref": "#/$defs/Margins"
      +    },
      +    "orientation": {
      +      "enum": [
      +        "portrait",
      +        "landscape"
      +      ],
      +      "type": "string"
      +    },
      +    "paper_size": {
      +      "enum": [
      +        "letter",
      +        "legal",
      +        "tabloid",
      +        "a3",
      +        "a4",
      +        "a5"
      +      ],
      +      "type": "string"
      +    },
      +    "print_area": {
      +      "description": "e.g. 'A1:H40'; '' prints the whole sheet.",
      +      "type": "string"
      +    },
      +    "scale": {
      +      "description": "Percent; not with fit_to_pages.",
      +      "maximum": 400,
      +      "minimum": 10,
      +      "type": "integer"
      +    },
      +    "title_columns": {
      +      "description": "Columns to repeat, e.g. 'A:B'; '' clears.",
      +      "type": "string"
      +    },
      +    "title_rows": {
      +      "description": "Rows to repeat, e.g. '1:2'; '' clears.",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / $defs / Protection
      Added value: +{
      +  "properties": {
      +    "allow": {
      +      "default": [
      +        "select_locked_cells",
      +        "select_unlocked_cells"
      +      ],
      +      "description": "Still allowed.",
      +      "items": {
      +        "enum": [
      +          "select_locked_cells",
      +          "select_unlocked_cells",
      +          "format_cells",
      +          "format_columns",
      +          "format_rows",
      +          "insert_columns",
      +          "insert_rows",
      +          "insert_hyperlinks",
      +          "delete_columns",
      +          "delete_rows",
      +          "sort",
      +          "auto_filter",
      +          "pivot_tables"
      +        ],
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "enabled": {
      +      "description": "False unprotects.",
      +      "type": "boolean"
      +    },
      +    "password": {
      +      "description": "To set; to unprotect, the current one.",
      +      "maxLength": 255,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "enabled"
      +  ],
      +  "type": "object"
      +}
    • removedInput schema / $defs / RowHeight
      Removed value: -{
      -  "description": "The height of one row.",
      -  "properties": {
      -    "height": {
      -      "description": "Height in points.",
      -      "exclusiveMinimum": 0,
      -      "maximum": 409,
      -      "title": "Height",
      -      "type": "number"
      -    },
      -    "row": {
      -      "description": "1-based row number.",
      -      "maximum": 1048576,
      -      "minimum": 1,
      -      "title": "Row",
      -      "type": "integer"
      -    }
      -  },
      -  "required": [
      -    "row",
      -    "height"
      -  ],
      -  "title": "RowHeight",
      -  "type": "object"
      -}
    • removedInput schema / $defs / SheetLayout / description
      Removed value: -"Layout changes. Fields left as null are not changed."
    • addedInput schema / $defs / SheetLayout / properties / auto_filter / $ref
      Added value: +"#/$defs/AutoFilter"
    • removedInput schema / $defs / SheetLayout / properties / auto_filter / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / SheetLayout / properties / auto_filter / default
      Removed value: -null
    • changedInput schema / $defs / SheetLayout / properties / auto_filter / description
      Previous value: -"Range with filter buttons, e.g. 'A1:F100'."New value: +"Rows that fail the criteria are hidden."
    • removedInput schema / $defs / SheetLayout / properties / auto_filter / title
      Removed value: -"Auto Filter"
    • removedInput schema / $defs / SheetLayout / properties / autofit_columns / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / SheetLayout / properties / autofit_columns / default
      Removed value: -null
    • changedInput schema / $defs / SheetLayout / properties / autofit_columns / description
      Previous value: -"Column letters to size to their content, e.g. ['A', 'C']."New value: +"Column letters sized to their text."
    • addedInput schema / $defs / SheetLayout / properties / autofit_columns / items
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / $defs / SheetLayout / properties / autofit_columns / title
      Removed value: -"Autofit Columns"
    • addedInput schema / $defs / SheetLayout / properties / autofit_columns / type
      Added value: +"array"
    • removedInput schema / $defs / SheetLayout / properties / column_widths
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "items": {
      -        "$ref": "#/$defs/ColumnWidth"
      -      },
      -      "type": "array"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Widths to set.",
      -  "title": "Column Widths"
      -}
    • addedInput schema / $defs / SheetLayout / properties / column_widths_chars
      Added value: +{
      +  "additionalProperties": {
      +    "maximum": 255,
      +    "type": "number"
      +  },
      +  "description": "Column letter to width in characters, {'A': 20}.",
      +  "type": "object"
      +}
    • addedInput schema / $defs / SheetLayout / properties / columns
      Added value: +{
      +  "items": {
      +    "$ref": "#/$defs/LineAction"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / $defs / SheetLayout / properties / freeze_panes / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / SheetLayout / properties / freeze_panes / default
      Removed value: -null
    • changedInput schema / $defs / SheetLayout / properties / freeze_panes / description
      Previous value: -"First unfrozen cell: 'A2' freezes row 1, 'A1' unfreezes."New value: +"First unfrozen cell: 'A2' freezes row 1; 'A1' unfreezes."
    • removedInput schema / $defs / SheetLayout / properties / freeze_panes / title
      Removed value: -"Freeze Panes"
    • addedInput schema / $defs / SheetLayout / properties / freeze_panes / type
      Added value: +"string"
    • addedInput schema / $defs / SheetLayout / properties / position
      Added value: +{
      +  "description": "1-based tab position.",
      +  "type": "integer"
      +}
    • addedInput schema / $defs / SheetLayout / properties / print_setup
      Added value: +{
      +  "$ref": "#/$defs/PrintSetup"
      +}
    • addedInput schema / $defs / SheetLayout / properties / protection
      Added value: +{
      +  "$ref": "#/$defs/Protection"
      +}
    • removedInput schema / $defs / SheetLayout / properties / row_heights
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "items": {
      -        "$ref": "#/$defs/RowHeight"
      -      },
      -      "type": "array"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Heights to set.",
      -  "title": "Row Heights"
      -}
    • addedInput schema / $defs / SheetLayout / properties / row_heights_pt
      Added value: +{
      +  "additionalProperties": {
      +    "maximum": 409,
      +    "type": "number"
      +  },
      +  "description": "Row number to height in points, {'1': 30}.",
      +  "type": "object"
      +}
    • addedInput schema / $defs / SheetLayout / properties / rows
      Added value: +{
      +  "items": {
      +    "$ref": "#/$defs/LineAction"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / $defs / SheetLayout / properties / tab_color / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / $defs / SheetLayout / properties / tab_color / default
      Removed value: -null
    • changedInput schema / $defs / SheetLayout / properties / tab_color / description
      Previous value: -"Sheet tab hex color."New value: +"Hex."
    • removedInput schema / $defs / SheetLayout / properties / tab_color / title
      Removed value: -"Tab Color"
    • addedInput schema / $defs / SheetLayout / properties / tab_color / type
      Added value: +"string"
    • addedInput schema / $defs / SheetLayout / properties / view
      Added value: +{
      +  "$ref": "#/$defs/ViewOptions"
      +}
    • addedInput schema / $defs / SheetLayout / properties / visibility
      Added value: +{
      +  "description": "One sheet must stay visible.",
      +  "enum": [
      +    "visible",
      +    "hidden"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / $defs / SheetLayout / title
      Removed value: -"SheetLayout"
    • addedInput schema / $defs / ViewOptions
      Added value: +{
      +  "properties": {
      +    "active": {
      +      "const": true,
      +      "description": "Show this sheet when the file opens.",
      +      "type": "boolean"
      +    },
      +    "gridlines": {
      +      "type": "boolean"
      +    },
      +    "headings": {
      +      "description": "Row and column labels.",
      +      "type": "boolean"
      +    },
      +    "right_to_left": {
      +      "type": "boolean"
      +    },
      +    "selected_cell": {
      +      "description": "e.g. 'B2'.",
      +      "type": "string"
      +    },
      +    "show_formulas": {
      +      "type": "boolean"
      +    },
      +    "zoom": {
      +      "maximum": 400,
      +      "minimum": 10,
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
    • 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 / sheet / description
      Removed value: -"Worksheet name, e.g. 'Sheet1'."
    • removedInput schema / properties / sheet / title
      Removed value: -"Sheet"
    • removedInput schema / title
      Removed value: -"set_sheet_layoutArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "set_sheet_layoutOutput",
      -  "type": "object"
      -}New value: +null
  2. Addedv1.1.1

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already declare the safety profile (not read-only, not destructive, not idempotent), so the bar is lower, and the description adds genuine value beyond them: protection is not real security, the password is weakly hashed, and it does not stop the server. That is an important operational caveat an agent could not infer from the annotations or schema.

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?

Two tight paragraphs: the feature scope first, the behavioral caveat second. The opening is a long laundry list, but every item corresponds to real schema capability and nothing is padding.

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 broad mutation tool with no output schema, the description gives a good map of what can be set and a key caveat. It omits partial-update semantics (what happens to unspecified layout fields) and failure behavior, which matter for a multi-option setter targeting a specific path/sheet.

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 schema coverage is 0% (path, sheet, and layout have no descriptions anywhere), but the nested $defs are heavily documented, and the description's enumerated feature list maps onto the layout sub-properties. It compensates partially but never explains the top-level path/sheet/layout contract, so it lands at baseline rather than above it.

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 ('Set') and enumerates the layout aspects it controls (column widths, row heights, panes, auto filter, tab color, visibility, print setup, protection), which lets an agent distinguish it from cell-level siblings like format_range. It does not explicitly name an alternative, but the enumeration itself carves out the resource scope well.

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?

No statement of when to use this tool versus format_range, set_workbook_settings, or describe_sheet, and no prerequisites are named. The only guidance offered is the protection caveat, which explains a side effect rather than when to select this tool.

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