Skip to main content
Glama
KitchenSink4AI

io.github.nometalalchemist/kitchensink4xl

Replace Cells

replace_cells
Destructive

Find and replace text or formulas across an Excel workbook, sheet, or range, with exact, substring, or regex matching, plus dry-run previews and batch application.

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.4/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the description's job is to add behavioral nuance. It does this richly: atomic batch application, auto-backup to .ks4xl-backups, refusal while open in Excel, hazardous workbook gating, formula-injection blocking, and number conversion of replaced values. These details go well beyond the annotations and materially inform an agent about side effects and safety. No contradiction with annotations.

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?

The description is long but justifiably so for a tool with 13 parameters and significant safety implications. It front-loads the core purpose and then layers details logically. Every sentence adds value, though some clauses (e.g., the exact regex timeout mention) could be trimmed without loss. Overall, it is well-structured and dense without being wasteful.

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 mutation tool with no output schema and 0% schema coverage, the description covers the critical operational aspects: scope selection, match semantics, dry-run preview, batch application, return reporting (cells changed and occurrences replaced), safety guards (injection, hazardous workbook, Excel lockout), and backup/atomicity. It even explains output behavior, compensating for the lack of an output schema. Nothing essential is missing for an agent to invoke it correctly.

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 0%, so the description must compensate. It explains key parameters: match (exact/contains/regex), look_in (values/formulas/both), dry_run, formulas (injection), allow_loss (hazardous workbook), and backup (auto-backup). However, it does not explain location, match_case, verify_com, or the precise interplay of sheet vs location. Given the 0% coverage, the description covers the most critical parameters but leaves some gaps, so a 4 is appropriate.

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-resource pair: 'Find-and-replace across a workbook, sheet, or range.' This clearly distinguishes it from siblings like find_cells (read-only search) and set_cell (single cell write). The purpose is unambiguous and immediately actionable.

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

Usage Guidelines3/5

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

The description provides extensive context about how the tool behaves (match modes, dry-run, batch application, safety guards) but does not explicitly say when to choose this tool over alternatives like set_cell or find_cells. The usage is implied through the detailed behavior, but there is no explicit when-to-use/when-not-to-use guidance or mention of sibling tools.

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