Skip to main content
Glama
Claude File Manager MCP

Claude File Manager MCP

by sadd11

Edit a file

edit_file

Replace an exact text occurrence with new content, view the resulting diff, and keep a backup for undo.

Instructions

Replaces an exact occurrence of old_string with new_string and shows a diff. If old_string occurs more than once, set replace_all=true explicitly. A backup is saved before editing (undo_last_change).

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": {
      "path": "<path>",
      "old_string": "<old_string>",
      "new_string": "<new_string>"
    },
    "name": "edit_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile path
new_stringYesReplacement text (may be empty to delete the fragment)
old_stringYesText to find
replace_allNoReplace all occurrences instead of only the unique one

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A3.9/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 reasonably well: it discloses that a diff is returned, that a backup is saved before editing, and that ambiguous matches require explicit replace_all. It omits what happens when old_string is not found (error vs no-op) and any permission or overwrite caveats.

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 short sentences, front-loaded with the core action, then the ambiguity rule, then the safety net. No filler and nothing buried.

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 4-parameter mutation tool with no annotations and no output schema, the description covers the key behaviors an agent needs: diff feedback, backup/undo, and the multi-match rule. The main remaining gap is failure behavior when the target string is absent.

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 100%, so baseline is 3, but the description adds real meaning: old_string must match exactly, and replace_all must be set explicitly when the string is non-unique. That clarifies the interaction between the two string parameters beyond the schema's field-level text.

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 resource: replaces an exact occurrence of old_string with new_string and shows a diff. The 'exact occurrence' phrasing distinguishes it from a whole-file write, though it never names write_file or multi_edit as the alternatives.

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 conditional rule: if old_string occurs more than once, set replace_all=true explicitly. It also points to undo_last_change for reverting. However, it never says when to choose this over write_file, append_file, or multi_edit, so routing guidance is only implied.

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