Skip to main content
Glama
Claude File Manager MCP

Claude File Manager MCP

by sadd11

Replace text in many files

replace_in_files

Replaces every occurrence of a text string or regex across text files, with per-file backups, dry-run preview, and a single undo step. Skips binary files, node_modules, .git, and .mcp by default.

Instructions

Replaces every occurrence of a string (or regular expression) across text files, with a backup of each changed file and a single undo step. Skips binary and very large files, node_modules, .git and .mcp by default. Use dry_run=true to preview the changes first.

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": {
      "query": "<query>",
      "replacement": "<replacement>"
    },
    "name": "replace_in_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoWhere to search (defaults to root).
queryYesText or regular expression to find
ignoreNoAdditional names/globs to skip
dry_runNoOnly report what would change; do not write files
includeNoFile glob, e.g. `*.js` or `src/**/*.ts`
is_regexNoTreat query as a regular expression
max_filesNoStop after changing this many files
replacementYesReplacement text (may be empty)
max_file_sizeNoSkip files larger than this size (bytes)
case_sensitiveNoMatch case

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does real work: it discloses automatic backups of each changed file, a single undo step, default skip lists (binary, very large files, node_modules, .git, .mcp), and the max-files stop condition. It leaves out what the operation returns and how partial failures/atomicity are handled, which matters for a bulk mutator.

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?

Three tight sentences, front-loaded with what the tool does, then safety/skip behavior, then the preview recommendation. Every clause carries information an agent needs before calling.

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 10-parameter bulk mutation tool with no annotations and no output schema, the description covers the destructive-action safety profile well: backups, undo, skip rules, dry_run. The main gap is the absence of any statement about what is returned (e.g. list of changed files) or how partial/invalid-regex failures surface.

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 all ten parameters are already documented in structured data and the baseline is 3. The description reinforces dry_run and clarifies that the ignore defaults are additive skip rules, but adds no new syntax or format detail beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and scope: 'Replaces every occurrence of a string (or regular expression) across text files', which distinguishes bulk cross-file replacement from single-file tools like edit_file or multi_edit. It stops short of naming any sibling, so differentiation is implied rather than explicit.

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?

Gives one concrete usage cue — 'Use dry_run=true to preview the changes first' — which is genuinely actionable. It does not say when to prefer this over edit_file/multi_edit, nor when search_content would be the right first step instead.

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