Skip to main content
Glama

Edit a file

fs_edit
Destructive

Replace an exact string in a file. old_string must match exactly once (include surrounding lines to make it unique) unless replace_all is set. Fails without changing anything if it is not found.

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

Input Schema

NameRequiredDescriptionDefault
pathYesPath starting with "workspace/" (the code, /workspace) or "data/" (runtime files, /data).
projectYesProject slug or id.
new_stringYes
old_stringYes
replace_allNo
idempotency_keyNoAny unique string; repeating a call with the same key does not repeat its effect.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and idempotentHint=false, and the description adds genuinely new behavioral detail: the match must be unique, surrounding lines are the remedy, and the operation is atomic ("fails without changing anything if it is not found"). It does not mention the idempotency_key parameter or how retry-safety works despite the annotation declaring non-idempotent.

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 action, then the uniqueness rule, then the failure guarantee. No filler and no restatement of the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, non-idempotent mutation with 6 parameters, the definition covers matching and failure semantics but is silent on the idempotency_key retry contract and on what a successful call reports back (no output schema). An agent can call it safely for the happy path but lacks guidance on retries after a failed no-match.

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?

With only 50% schema coverage, the description compensates well for the two most important parameters: old_string (exact, minLength 1, must be unique, widen with context) and replace_all (relaxes the uniqueness requirement). It adds nothing for project, and nothing for idempotency_key, which is the least self-explanatory field in 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?

"Replace an exact string in a file" gives a specific verb (replace) and resource (file) with string-matching scope, clearly separating it from whole-file writers like fs_write. It does not name or contrast any sibling explicitly, so an agent must infer that fs_write is for full writes.

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 implies the use case (targeted in-place edits to existing content) via the exact-match requirement, and it explains when to use replace_all versus a unique match. It never states when to prefer fs_edit over fs_write or fs_import, so alternative selection is left to inference.

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