Skip to main content
Glama
xlsx-for-ai

xlsx-for-ai

by senoff

xlsx_healer_cure

Destructive

Repairs a diagnosed .xlsx workbook by applying one targeted operation, such as fixing broken external references or flagging unsupported Google Sheets formulas.

Instructions

Use this when you need to apply one specific repair to a diagnosed workbook. For broken external references: rewrite ref paths, freeze / redirect / localize a deleted source, strip embedded credentials, or collapse multi-hop chains. For Google-Sheets-to-Excel export damage: flag each dead Sheets-only formula with an in-cell note so the loss is visible (it does NOT recompute the function — a Sheets-only function has no Excel equivalent to compute), trim an oversized used-range, and compact repeated formulas into Excel shared-formula form.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_path": "<file_path>",
      "operation": "<operation>"
    },
    "name": "xlsx_healer_cure"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoas_copy (default) writes a new file alongside the source; in_place overwrites it.
confirmNoRequired as true when mode=in_place. Prevents accidental in-place overwrites; explicit confirmation is the safety gate.
out_pathNoOptional: write the cured workbook to this absolute path. Defaults to <name>-healed.xlsx next to the source when mode=as_copy.
file_pathYesAbsolute path to the .xlsx file to cure.
operationYesThe cure operation to apply.
cure_paramsNoOperation-specific parameters. E.g., rename_move takes {from_prefix, to_prefix}; pattern_bulk takes {pattern, replacement}.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv4.3.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / confirm
      Added value: +{
      +  "description": "Required as true when mode=in_place. Prevents accidental in-place overwrites; explicit confirmation is the safety gate.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / cure_params / description
      Added value: +"Operation-specific parameters. E.g., rename_move takes {from_prefix, to_prefix}; pattern_bulk takes {pattern, replacement}."
    • removedInput schema / properties / file_b64
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / file_path
      Added value: +{
      +  "description": "Absolute path to the .xlsx file to cure.",
      +  "type": "string"
      +}
    • removedInput schema / properties / intent
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / mode / description
      Added value: +"as_copy (default) writes a new file alongside the source; in_place overwrites it."
    • addedInput schema / properties / operation / description
      Added value: +"The cure operation to apply."
    • addedInput schema / properties / operation / enum
      Added value: +[
      +  "rename_move",
      +  "pattern_bulk",
      +  "source_deleted_freeze",
      +  "source_deleted_redirect",
      +  "source_deleted_localize",
      +  "permission_denied",
      +  "structure_changed",
      +  "format_change",
      +  "make_standalone",
      +  "chain_collapse",
      +  "modernize_to_pq"
      +]
    • addedInput schema / properties / out_path
      Added value: +{
      +  "description": "Optional: write the cured workbook to this absolute path. Defaults to <name>-healed.xlsx next to the source when mode=as_copy.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "file_b64",
      -  "operation"
      -]New value: +[
      +  "file_path",
      +  "operation"
      +]
  2. First observedv3.2.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare this a destructive, non-idempotent, non-read-only write, so the description is not obliged to restate that. It still adds genuine behavioral context beyond them: the explicit caveat that dead Sheets-only formulas are flagged with an in-cell note and are NOT recomputed, plus that credential stripping happens as part of reference rewrites. It does not describe the returned result or the safety gate for in_place writes, which lives in the schema.

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?

Two sentences: the first front-loads the when-to-use condition, the second enumerates repair capabilities grouped by damage class. The long enumeration is dense but every listed repair maps to a distinct capability the agent could not infer elsewhere; nothing is redundant with the name or annotations.

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 destructive, enum-driven mutation tool with no output schema, the description covers what the tool does across both damage categories and the key semantic caveat about non-recomputation. It does not address what the tool returns or how failures/partial cures are surfaced, which an agent would want before invoking a destructive operation.

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

Parameters3/5

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

Schema description coverage is 100%, so mode, confirm, out_path, operation and cure_params are already documented with examples. The description adds meaning about the effect of specific operations (e.g., dead Sheets formulas are annotated in-cell rather than recomputed), but it does not map operation enum values to their cure_params shapes beyond what the schema states. Baseline 3 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?

States a specific verb and resource ('apply one specific repair to a diagnosed workbook') and then enumerates the concrete repair classes: external-reference rewrites (freeze/redirect/localize, credential stripping, chain collapse) and Google-Sheets export damage (dead-formula flagging, used-range trimming, shared-formula compaction). An agent can tell this is the mutation step that follows diagnosis rather than another diagnostic read.

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 opening clause gives clear context ('when you need to apply one specific repair to a diagnosed workbook'), implying the diagnose step precedes this one and that calls should be scoped to one operation. It does not explicitly name alternatives such as xlsx_healer_simulate for previewing or xlsx_healer_diagnose for detection, and it gives no exclusions or prerequisites, so guidance is clear but not complete.

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