Skip to main content
Glama

Edit Excel Values and Formulas

xl_edit
Destructive

Edit Excel workbook values and formulas: set cells, write/clear/copy/move ranges, batch apply edits, find/replace, and import CSV/TSV/JSON with backups and atomic saves.

Instructions

Values and formulas: set one or many cells, write, clear, copy or move ranges, the batch editor (apply_edits), find and replace, and CSV, TSV or JSON import. A string starting with '=' is always stored as a formula. Formatting is xl_format; sheets, rows and tables are xl_structure. Every change backs the file up first, saves atomically and verifies after writing. Refuses a workbook open in Excel, and a workbook whose fragile parts a save would drop unless allow_loss is true. Ops, one per line, as name(required; opt optional): what it does. path, backup and verify_com are not repeated; xl_help shows them:

  • set_cell(location, value; opt sheet allow_loss): Write one cell by location; a string starting with '=' is always stored as a formula.

  • set_cells(cells; opt sheet echo_cells allow_loss): Write many individually addressed cells as ONE atomic batch, the scatter complement to write_range.

  • write_range(location, data; opt sheet parse_dates echo_cells allow_loss): Write a rectangular 2D block of values and formulas from the location's top-left cell; ragged rows are refused.

  • clear_range(location; opt what sheet allow_loss): Clear a cell or range: what='contents' removes values and formulas, 'formats' resets styles to default, 'all' does both.

  • copy_range(source, dest; opt what adjust_formulas sheet allow_loss): Copy a source rectangle to a destination anchor (location objects, may name different sheets).

  • move_range(source, dest; opt sheet allow_loss): Move a rectangle on the same sheet, rewriting every reference into it so references follow the cells.

  • apply_edits(edits; opt echo_cells allow_loss): Apply many addressed edits as ONE atomic batch.

  • replace_cells(find, replace; opt look_in match match_case sheet location dry_run formulas allow_loss): Find and replace across a workbook, sheet or range (exact, contains or regex); dry_run=true changes nothing. 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: - set_formula(location, formula; opt sheet echo_cells allow_loss): Write a formula to a cell, or fill a range with relative references shifted per cell; results stay stale until recalculated. - import_data(opt source source_file fmt location sheet header delimiter encoding formulas column_types parse_dates echo_cells allow_loss): Import CSV, TSV or JSON text or a file at a location; codes such as IDs and zip codes stay text, and the result says which columns.
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.9/5.0
Behavior5/5

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

Annotations already declare destructive=true and non-idempotent, and the description adds materially important behavior: every change backs up, saves atomically, verifies after writing, refuses workbooks open in Excel, and refuses fragile workbooks unless allow_loss is true. It also explains the '=' formula storage rule and stale recalculation behavior for set_formula.

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?

Despite being long, it is front-loaded with the main purpose, alternatives, and safety behavior, then uses compact op lines with required/optional notation. The length is justified by 10 operations and safety-critical details, with no obvious filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex, destructive workbook mutation tool with no output schema, the description covers purpose, sibling routing, atomicity, backup, verification, failure conditions, formula semantics, and per-op argument shapes. An agent has enough information to select the tool and invoke the right operation without needing another tool first.

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

Parameters4/5

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

Schema coverage is 100%, so the schema establishes baseline semantics, but the description adds meaningful operational context: each op line lists required and optional arguments, explains that path/backup/verify_com are not repeated, and warns that unknown keys are refused. It still defers full argument documentation to xl_help, so it stops short of fully self-contained parameter semantics.

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?

States a specific verb and resource (edit Excel values and formulas) and enumerates the operation families covered, including cell writes, ranges, batch edits, replace, and import. It explicitly distinguishes itself from xl_format for formatting and xl_structure for sheets, rows, and tables, so an agent can route correctly from the description alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names alternatives and when to use them: xl_format for formatting, xl_structure for sheets/rows/tables, and per-op distinctions such as set_cells as the scatter complement to write_range. It also gives concrete usage conditions like dry_run=true changing nothing and apply_edits being an atomic batch.

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