Skip to main content
Glama

Excel Formatting and Objects

xl_format
Destructive

Apply and manage Excel cell and sheet formatting, including number formats, fonts, fills, borders, styles, merges, conditional formats, comments, hyperlinks, images, charts, dimensions, and views.

Instructions

How cells look and what sits on the sheet: number formats, fonts, fills, borders, named styles, the format painter, column widths and row heights, merges, conditional formats, comments, hyperlinks, images, charts and sheet view. Values are xl_edit. Every change backs the file up first; refuses a workbook open in Excel. Ops, one per line, as name(required; opt optional): what it does. path, backup and verify_com are not repeated; xl_help shows them:

  • format_cells(location; opt number_format font fill border alignment sheet allow_loss): Apply formatting to a range, merging onto the existing style so unspecified attributes are preserved.

  • apply_style(style; opt location define sheet allow_loss): Apply a NAMED cell style to a range, optionally defining it first.

  • copy_format(source, dest; opt sheet allow_loss): Copy one cell's complete format onto every cell of a destination range, leaving values untouched.

  • set_dimensions(opt sheet column_widths row_heights autofit_columns hide_columns hide_rows group_rows group_columns ungroup_rows ungroup_columns outline_summary allow_loss): Set column widths and row heights, hide or group rows and columns; autofit here is an estimate (xl_app com_autofit is exact).

  • set_merge(action; opt location sheet confirm_data_loss allow_loss): Merge or unmerge cell ranges, or list every merge.

  • manage_conditional_format(action; opt location cf_type params sheet index allow_loss): Add, list or delete conditional-formatting rules (cell_is, formula, color scales, data bars, icon sets and more).

  • manage_comment(action; opt location text author sheet allow_loss): Add, edit, delete or list cell notes; list also reads threaded comments. Leave author out to sign with the user's own name, or pass author="assistant" to sign as "AI Assistant via KS4XL". More ops follow, in the same format, in the op parameter's description.

Input Schema

NameRequiredDescriptionDefault
opYesThe operation to run: an op listed in this tool's description, or one of these, in the same format: - manage_hyperlink(action; opt location target display tooltip sheet allow_loss): Add, remove or list cell hyperlinks (a URL or an in-workbook reference); remove keeps the cell's text. - manage_image(action; opt image_file location sheet width height index out_dir allow_loss): Insert, list, delete or extract cell-anchored images. - manage_chart(action; opt chart_type data categories title x_title y_title at_cell sheet index titles_from_data show_axes allow_loss): Create, list or delete charts (bar, bar_horizontal, line, pie, doughnut, area, scatter); at_cell places one. - set_view(opt sheet freeze split gridlines headings zoom selection tab_color allow_loss): Set freeze or split panes, gridlines, headings, zoom, selection and tab color for a sheet; unset values stay.
argsNoThe op's arguments as an object. Include path (the workbook file) unless the op's line names other paths or the op reads no workbook; unknown keys are refused. xl_help lists every argument.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description adds crucial behavioral details: 'Every change backs the file up first,' it refuses workbooks open in Excel, format_cells merges onto existing style preserving unspecified attributes, and several ops expose allow_loss/confirm_data_loss controls. It also explains comment author signing behavior, which is meaningful operational context.

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 front-loaded with the tool's scope, then gives a compact operational preamble before listing ops in a consistent name(required; opt optional): what it does format. The length is justified by the dispatcher's 11 operations, and the structure makes scanning efficient.

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?

For a complex dispatcher with many op-specific arguments and no output schema, the description covers scope, preconditions, backup behavior, and all operation families well. It defers common argument details to xl_help, which is reasonable, but it does not describe what successful operations return, leaving a minor completeness gap.

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?

Although top-level schema coverage is 100%, the schema only exposes op and args; the description compensates by documenting each op's required and optional arguments and their semantics in-line. It also notes that path, backup, and verify_com are not repeated and points to xl_help for those common arguments.

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 states a specific resource scope—cell appearance and sheet objects—and enumerates the operation families (formats, styles, dimensions, merges, conditional formats, comments, hyperlinks, images, charts, view). It also explicitly distinguishes formatting from value editing with 'Values are xl_edit,' so an agent can separate this tool from the value-editing sibling.

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?

It gives clear context for when to use the tool and names key alternatives: 'Values are xl_edit' for value changes and 'xl_app com_autofit is exact' for exact autofit. It also states the precondition 'refuses a workbook open in Excel,' though it does not explicitly list when-not-to-use cases beyond that.

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