Skip to main content
Glama

Excel Sheets, Rows and Tables

xl_structure
Destructive

Modify Excel workbook structure by adding or deleting sheets, rows, columns, tables, and named ranges; sort, filter, and validate data while rewriting references and backing up files.

Instructions

Workbook structure: add, rename, delete or hide sheets, insert or delete rows and columns (references are rewritten), tables, named ranges, sort, filters and data validation. 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:

  • manage_worksheet(action; opt sheet new_name index state allow_loss): Add, delete, rename, copy, reorder, hide or unhide a sheet; rename rewrites references to it and delete turns them into #REF!, as Excel does.

  • modify_grid_structure(action, at; opt count sheet allow_loss): Insert or delete rows or columns and rewrite every reference on every sheet; references inside a deleted band become #REF!.

  • create_table(location, name; opt header style row_stripes col_stripes totals_row totals sheet allow_loss): Turn a range into an Excel table (ListObject) named name.

  • manage_table(name, action; opt values index column new_name new_ref style on totals row_stripes col_stripes sheet allow_loss): Add or delete rows and columns, rename, resize, toggle totals, restyle or unlist the table named name (action).

  • manage_name(action; opt name refers_to scope new_name allow_loss): Add, delete, rename, update or list defined names; an ambiguous name refuses until scope is given.

  • sort_range(location, keys; opt has_header sheet allow_loss): Sort a range or table body by one or more keys, writing the rows back reordered.

  • set_filter(location; opt criteria sheet allow_loss): Apply an autofilter and hide the rows that do not meet all criteria; rows with uncalculated formulas stay visible.

  • clear_filter(opt location sheet allow_loss): Remove the autofilter from a sheet and unhide the rows it hid, the reverse of set_filter. 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_data_validation(action; opt location dv_type values operator formula1 formula2 allow_blank prompt error sheet allow_loss): Add, list or delete data-validation rules (list, whole, decimal, date, time, text_length, custom); Excel enforces them.
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.6/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the safety net ('Every change backs the file up first'), the external precondition ('refuses a workbook open in Excel'), and concrete destructive consequences ('rename rewrites references to it and delete turns them into #REF!', 'references inside a deleted band become #REF!'). These are exactly the mutation risks an agent needs to plan around.

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?

Front-loads the scope and safety rules in two sentences, then uses a consistent machine-scannable one-line-per-op format where every clause carries information. Minor deduction for splitting the op catalogue across the description and the 'op' schema description, forcing the agent to read two places.

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 nine-op multiplexer with no output schema, it covers scope, argument shapes, reference-rewrite side effects and preconditions. It stops short of saying what list-style ops (manage_name list, manage_data_validation list) return, which matters for a tool with no output schema.

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?

The schema's 'args' is a free-form object with additionalProperties, so structure alone conveys almost nothing. The description compensates fully with a compact 'name(required; opt optional)' signature per op plus the shared path/backup/verify_com note, giving real meaning to otherwise opaque keys.

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?

Opens with a specific scope statement: 'Workbook structure: add, rename, delete or hide sheets, insert or delete rows and columns... tables, named ranges, sort, filters and data validation.' It also draws the sibling boundary explicitly with 'Values are xl_edit', so an agent knows structure operations belong here and cell content does not.

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?

Each op line states the task it performs, which effectively routes the agent to the right op (e.g. 'clear_filter ... the reverse of set_filter'). The precondition 'refuses a workbook open in Excel' is stated, but there is no explicit when-not guidance relative to xl_format or xl_workbook.

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