Skip to main content
Glama
KitchenSink4AI

io.github.nometalalchemist/kitchensink4xl

replace_cells

Find and replace cell values or formulas across a workbook, sheet, or range using exact, contains, or regex matching. Preview changes with dry_run, then apply the entire plan as one validated batch with automatic backup.

Instructions

Find-and-replace across a workbook, sheet, or range. match is exact (whole cell), contains (literal substring), or regex (timeout-guarded; backreferences like \1 work in replace). look_in 'values' rewrites literal cells, 'formulas' rewrites formula text (the cell stays a formula, normalized), 'both' does both. dry_run=true previews every change without touching the file; a real run validates the whole plan first, applies it as ONE batch, and reports cells changed and occurrences replaced. A replaced value that parses as a number is written as a number; replacement text beginning with =, +, -, or @ is written as TEXT to block formula injection unless formulas is true. A hazardous workbook refuses unless allow_loss is true. Auto-backup to .ks4xl-backups; atomic verified save. Refuses while open in Excel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
findYes
pathYes
matchNocontains
sheetNo
backupNo
dry_runNo
look_inNovalues
replaceYes
formulasNo
locationNo
allow_lossNo
match_caseNo
verify_comNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.2.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  2. Changed2 schema fields changedv1.1.0
    • addedInput schema / properties / location / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / location / title
      Removed value: -"Location"
  3. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

With only readOnlyHint=false provided, the description carries the full behavioral burden and does so thoroughly. It discloses dry-run semantics, one-batch atomic application, formula injection prevention, number coercion, hazardous-workbook refusal, auto-backup, and refusal while open in Excel. This far exceeds what annotations alone provide, and it does not contradict them.

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 dense but front-loaded with the core purpose, and every clause adds relevant behavioral or safety detail. There is no filler or repetition of schema fields, making the length appropriate for a tool with 13 parameters and no schema descriptions.

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 mutating tool with no output schema, sparse annotations, and zero parameter descriptions, this definition is nearly complete: it covers calling modes, safety constraints, return reporting, and failure conditions. The main gaps are the undocumented match_case and verify_com behaviors and the precise format accepted by the location parameter.

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 description coverage is 0%, and the description compensates strongly by explaining match modes, look_in behavior, dry_run, formulas, allow_loss, backup, and replacement-value safety rules. However, match_case and verify_com are not explained, and the exact syntax of the 'location' range object is left unspecified.

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 opens with a specific verb phrase, 'Find-and-replace across a workbook, sheet, or range,' which clearly identifies the operation and scope. This distinguishes it from siblings like find_cells (search-only) and set_cells (single-cell writes), so the agent can select the right tool without opening schemas.

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?

The description gives clear context for when this tool applies: bulk find-and-replace over a workbook, sheet, or range, with modes for matching, lookup targets, and dry runs. It does not explicitly name alternatives or state 'use X instead,' but the scope and behavior are specific enough to make the intended usage obvious.

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