Skip to main content
Glama

files_replace

Destructive

Finds and replaces text across cells in one transaction (the write counterpart of files_search). Only TEXT cells are changed — numbers, formulas, and code are left untouched. case_sensitive (default false) and whole_cell (default false: substring match; true: only cells equal to find). sheet scopes the replace to one sheet (defaults to all sheets). Returns { replaced: , skipped: <matches left as-is: numbers, formula output, table cells> }. Requires edit permission. Signature: files_replace(file_uuid, find, replace, sheet?, case_sensitive?, whole_cell?).

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_uuid": "<file_uuid>",
      "find": "<find>",
      "replace": "<replace>"
    },
    "name": "files_replace"
  }
}

Input Schema

NameRequiredDescriptionDefault
findYesText to search for.
sheetNoLimit to this sheet (defaults to all sheets).
replaceYesReplacement text (use empty string to delete the matched text).
file_uuidYes
whole_cellNoOnly replace cells equal to 'find' (default false).
case_sensitiveNoMatch case (default false).

Output Schema

NameRequiredDescriptionDefault
noteNo
skippedYes
replacedYes
file_uuidYes
sequence_numberNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

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 (destructiveHint=true, idempotentHint=false) by disclosing exactly what changes (text cells) and what is protected (numbers, formulas, code), the transactional nature, the required edit permission, and the replaced/skipped return breakdown. This is the kind of mutation-specific context annotations cannot carry.

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-loaded with purpose and constraints, then parameters, then return shape — a sensible order with no filler. The trailing 'Signature: files_replace(...)' line redundantly restates the schema's required/optional parameters and is the one element that does not earn its place.

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?

Covers scope, matching modes, permission requirements, return values (even though an output schema exists), and the read/write sibling relationship. For a destructive, non-idempotent mutation tool, nothing an agent needs to invoke it safely is missing.

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 83%, so the schema already documents most parameters; the description still adds the matching-mode distinction for whole_cell (substring vs exact cell equality) and default behaviors for case_sensitive and sheet. The file_uuid parameter is left unexplained but is self-evident.

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+resource ('finds and replaces text across cells') and explicitly positions itself as 'the write counterpart of files_search', letting an agent distinguish it from the sibling search tool without reading either schema. The scope constraint ('only TEXT cells') further sharpens the purpose.

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 'write counterpart of files_search' framing gives clear selection context between read and write operations, and the TEXT-only scope implies when this tool is inapplicable. It does not call out the other write siblings (files_write, files_write_batch) or state explicit exclusions, keeping it a step below a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources