Skip to main content
Glama

edit_content

Destructive

Modify large files using literal search/replace and fuzzy matching to avoid line-number errors; preview changes or apply them with automatic backups.

Instructions

Edit large files using search/replace with fuzzy matching.

Use instead of line-based editing to avoid LLM line number errors. Fuzzy
matching handles whitespace and formatting differences automatically.
Applies edits immediately by default and creates an automatic backup
(backup_created in the response) - use revert_edit to undo. The preview
field of the response holds the unified diff for post-hoc verification;
pass preview=true to dry-run first. Does NOT support regex in replacement
- patterns must be literal text (use fuzzy=true for flexibility).

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": {
      "absolute_file_path": "<absolute_file_path>",
      "changes": "<changes>"
    },
    "name": "edit_content"
  }
}

Input Schema

NameRequiredDescriptionDefault
fuzzyNoEnable fuzzy matching for all changes (default: true)
changesYesArray of {search, replace, fuzzy?} objects. Applied in order.
previewNoDry-run when true: shows the diff without writing. Default false: applies edits immediately, creates an automatic backup (returned as backup_created), and returns the unified diff in the preview field for post-hoc verification.
absolute_file_pathYesAbsolute path to target file

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.0.0
    • addedInput schema / properties / preview / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / preview / default
      Previous value: -trueNew value: +null
    • changedInput schema / properties / preview / description
      Previous value: -"Show diff preview without applying changes. Always preview first!"New value: +"Dry-run when true: shows the diff without writing. Default false: applies edits immediately, creates an automatic backup (returned as backup_created), and returns the unified diff in the preview field for post-hoc verification."
    • removedInput schema / properties / preview / type
      Removed value: -"boolean"
  2. First observedv0.3.0

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the destructiveHint=true/readOnlyHint=false annotations by disclosing that edits apply immediately by default, that an automatic backup is created and returned as backup_created, that the unified diff is in the preview field, and that revert_edit undoes changes. The only gap is that it doesn't state what happens if fuzzy matching fails or matches multiple locations, which matters for a destructive tool.

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 the core mechanism, then behavior, then the literal-text constraint. Every sentence carries information, though the preview/backup description partially duplicates the schema's own parameter text, adding mild redundancy.

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?

With no output schema, the description compensates by naming the response fields (backup_created, preview diff) and the recovery path. For a destructive, four-parameter tool this covers everything an agent needs to call it safely.

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 the baseline is 3, but the description adds real meaning the schema does not: replacements are literal text (no regex), fuzzy=true is the flexibility lever, and changes are applied in order with per-change fuzzy overrides. It clarifies intent behind preview and fuzzy rather than restating their types.

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 mechanism: edit files via search/replace with fuzzy matching, targeted at large files. It also positions itself against line-based editing and names revert_edit as the undo path, so an agent can distinguish it from siblings without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use (prefer over line-based editing to avoid line-number errors), when-not (no regex in replacements, patterns must be literal), and the escape hatches (preview=true for dry-run, revert_edit to undo). The alternatives and conditions are stated rather than implied.

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