Skip to main content
Glama

Edit Files

edit
Destructive

Replace exact, unique text snippets in up to 5 existing text files when you know the precise text to change; each file applies all-or-nothing, with dry-run diffs and optional undo.

Instructions

Replace exact, unique text snippets in up to 5 existing text files. Use when you know the exact text to change. Do not use it for every match of a pattern; use replace_text instead. To apply a unified diff, use patch; for a new file or a whole rewrite, use create. Each file is all or nothing: an unmatched or ambiguous oldText writes nothing to that file, and other files still run; dryRun reports unmatched text instead of failing. An oldText with no exact match is retried ignoring indentation and spacing and applied only if that matches once; the summary says so. Missing, binary, non-UTF-8, and over-size-cap (default 10 MiB) files fail. Returns one summary line per file (+added -removed, NO MATCH, or FAILED); a dry run or returnDiff appends unified diffs. With undo enabled, live runs add an undo id for undo, valid 30 minutes.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoOne file to edit; give edits with it. Not allowed with files
editsNoReplacements for path, applied in order; each oldText is matched against the text the earlier edits left. Required with path
filesNoBatch mode: one entry per file, each with its own edits
dryRunNoWrite nothing; return a unified diff per file. An unmatched oldText is reported instead of failing; an ambiguous one still fails
returnDiffNoInclude the unified diff in a live run. Cut at 20 KB per file.
ignoreWhitespaceNoMatch oldText ignoring indentation and spacing, never across line breaks; newText is re-indented to the match. Tried automatically when the exact text has no match

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.22.0
    • changedInput schema / properties / ignoreWhitespace / description
      Previous value: -"Match oldText ignoring indentation and spacing, never across line breaks; newText is re-indented to the match"New value: +"Match oldText ignoring indentation and spacing, never across line breaks; newText is re-indented to the match. Tried automatically when the exact text has no match"
    • addedInput schema / properties / returnDiff
      Added value: +{
      +  "default": false,
      +  "description": "Include the unified diff in a live run. Cut at 20 KB per file.",
      +  "type": "boolean"
      +}
  2. Changed9 schema fields changedv2.20.0
    • changedInput schema / properties / dryRun / description
      Previous value: -"Preview diffs without writing to disk (default: false = apply edits)"New value: +"Write nothing; return a unified diff per file. An unmatched oldText is reported instead of failing; an ambiguous one still fails"
    • changedInput schema / properties / edits / description
      Previous value: -"Replacements applied to path (required with path); not allowed with files"New value: +"Replacements for path, applied in order; each oldText is matched against the text the earlier edits left. Required with path"
    • changedInput schema / properties / edits / items / properties / oldText / description
      Previous value: -"Exact literal text to locate in the file; it must match exactly once. Include 3-5 lines of context so it does — an oldText found in several places fails with their line numbers."New value: +"Exact text to find. It must match exactly once, so include 3-5 lines of context. Several matches fail and list up to 5 line numbers."
    • changedInput schema / properties / files / description
      Previous value: -"Per-file entries (batch mode)"New value: +"Batch mode: one entry per file, each with its own edits"
    • changedInput schema / properties / files / items / properties / edits / description
      Previous value: -"Replacements to apply to this specific file"New value: +"Replacements for this file, applied in order; each oldText is matched against the text the earlier edits left"
    • changedInput schema / properties / files / items / properties / edits / items / properties / oldText / description
      Previous value: -"Exact literal text to locate in the file; it must match exactly once. Include 3-5 lines of context so it does — an oldText found in several places fails with their line numbers."New value: +"Exact text to find. It must match exactly once, so include 3-5 lines of context. Several matches fail and list up to 5 line numbers."
    • changedInput schema / properties / files / items / properties / path / description
      Previous value: -"File or directory path inside an allowed workspace root."New value: +"File to edit; each file appears once"
    • changedInput schema / properties / ignoreWhitespace / description
      Previous value: -"Ignore leading/trailing whitespace differences when matching oldText; newText is re-indented to the match and replaces its inner blank lines"New value: +"Match oldText ignoring indentation and spacing, never across line breaks; newText is re-indented to the match"
    • changedInput schema / properties / path / description
      Previous value: -"Single file path; mutually exclusive with files"New value: +"One file to edit; give edits with it. Not allowed with files"
  3. Changed2 schema fields changedv2.17.0
    • addedInput schema / properties / edits / items / properties / oldText / maxLength
      Added value: +1048576
    • addedInput schema / properties / files / items / properties / edits / items / properties / oldText / maxLength
      Added value: +1048576
  4. Changed1 schema field changedv2.13.0
    • changedInput schema / properties / ignoreWhitespace / description
      Previous value: -"Ignore leading/trailing whitespace differences when matching oldText"New value: +"Ignore leading/trailing whitespace differences when matching oldText; newText is re-indented to the match and replaces its inner blank lines"
  5. Changed2 schema fields changedv2.9.1
    • removedInput schema / oneOf
      Removed value: -[
      -  {
      -    "required": [
      -      "path",
      -      "edits"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "files"
      -    ]
      -  }
      -]
    • changedInput schema / properties / edits / description
      Previous value: -"Replacements applied to path; not allowed when using files"New value: +"Replacements applied to path (required with path); not allowed with files"
  6. Changed11 schema fields changedv2.8.1
    • removedInput schema / $defs
      Removed value: -{
      -  "EditSpec": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "newText": {
      -        "description": "Replacement text. Use an empty string to delete the matched oldText.",
      -        "examples": [
      -          "const x = 2;",
      -          "function newName(",
      -          ""
      -        ],
      -        "type": "string"
      -      },
      -      "oldText": {
      -        "description": "Exact literal text to locate in the file; it must match exactly once. Include 3-5 lines of context so it does — an oldText found in several places fails with their line numbers.",
      -        "examples": [
      -          "const x = 1;",
      -          "function oldName("
      -        ],
      -        "minLength": 1,
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "oldText",
      -      "newText"
      -    ],
      -    "type": "object"
      -  }
      -}
    • removedInput schema / properties / edits / items / $ref
      Removed value: -"#/$defs/EditSpec"
    • addedInput schema / properties / edits / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / edits / items / properties
      Added value: +{
      +  "newText": {
      +    "description": "Replacement text. Use an empty string to delete the matched oldText.",
      +    "examples": [
      +      "const x = 2;",
      +      "function newName(",
      +      ""
      +    ],
      +    "type": "string"
      +  },
      +  "oldText": {
      +    "description": "Exact literal text to locate in the file; it must match exactly once. Include 3-5 lines of context so it does — an oldText found in several places fails with their line numbers.",
      +    "examples": [
      +      "const x = 1;",
      +      "function oldName("
      +    ],
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / edits / items / required
      Added value: +[
      +  "oldText",
      +  "newText"
      +]
    • addedInput schema / properties / edits / items / type
      Added value: +"object"
    • removedInput schema / properties / files / items / properties / edits / items / $ref
      Removed value: -"#/$defs/EditSpec"
    • addedInput schema / properties / files / items / properties / edits / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / files / items / properties / edits / items / properties
      Added value: +{
      +  "newText": {
      +    "description": "Replacement text. Use an empty string to delete the matched oldText.",
      +    "examples": [
      +      "const x = 2;",
      +      "function newName(",
      +      ""
      +    ],
      +    "type": "string"
      +  },
      +  "oldText": {
      +    "description": "Exact literal text to locate in the file; it must match exactly once. Include 3-5 lines of context so it does — an oldText found in several places fails with their line numbers.",
      +    "examples": [
      +      "const x = 1;",
      +      "function oldName("
      +    ],
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / files / items / properties / edits / items / required
      Added value: +[
      +  "oldText",
      +  "newText"
      +]
    • addedInput schema / properties / files / items / properties / edits / items / type
      Added value: +"object"
  7. Changed3 schema fields changedv2.4.1
    • addedInput schema / $defs / EditSpec / properties / newText / examples
      Added value: +[
      +  "const x = 2;",
      +  "function newName(",
      +  ""
      +]
    • addedInput schema / $defs / EditSpec / properties / oldText / examples
      Added value: +[
      +  "const x = 1;",
      +  "function oldName("
      +]
    • addedInput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
  8. Changed1 schema field changedv2.3.0
    • changedInput schema / $defs / EditSpec / properties / oldText / description
      Previous value: -"Exact literal text to locate in the file. Must include 3-5 lines of context to ensure uniqueness and avoid matching the wrong block."New value: +"Exact literal text to locate in the file; it must match exactly once. Include 3-5 lines of context so it does — an oldText found in several places fails with their line numbers."
  9. Changed1 schema field changedv2.1.5
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": false,
      -  "properties": {
      -    "results": {
      -      "description": "Per-path edit results ordered to match the input paths",
      -      "items": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "error": {
      -            "additionalProperties": false,
      -            "description": "Error details; present on failure",
      -            "properties": {
      -              "code": {
      -                "type": "string"
      -              },
      -              "message": {
      -                "type": "string"
      -              },
      -              "path": {
      -                "type": "string"
      -              },
      -              "suggestion": {
      -                "type": "string"
      -              }
      -            },
      -            "required": [
      -              "code",
      -              "message"
      -            ],
      -            "type": "object"
      -          },
      -          "path": {
      -            "description": "Requested file path",
      -            "type": "string"
      -          },
      -          "value": {
      -            "additionalProperties": false,
      -            "description": "Edit result; present on success",
      -            "properties": {
      -              "appliedEdits": {
      -                "description": "Number of edits successfully applied",
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "diff": {
      -                "description": "Unified diff of all changes (present only in dryRun mode)",
      -                "type": "string"
      -              },
      -              "kind": {
      -                "description": "Broad file kind: text, binary, image, audio, or pdf",
      -                "enum": [
      -                  "text",
      -                  "binary",
      -                  "image",
      -                  "audio",
      -                  "pdf"
      -                ],
      -                "type": "string"
      -              },
      -              "lineCount": {
      -                "description": "Number of lines in the file after edits",
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "lineRange": {
      -                "description": "Line range [firstLine, lastLine] covering all applied edits",
      -                "prefixItems": [
      -                  {
      -                    "exclusiveMinimum": 0,
      -                    "type": "integer"
      -                  },
      -                  {
      -                    "exclusiveMinimum": 0,
      -                    "type": "integer"
      -                  }
      -                ],
      -                "type": "array"
      -              },
      -              "linesAdded": {
      -                "description": "Net lines added by all applied edits",
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "linesRemoved": {
      -                "description": "Net lines removed by all applied edits",
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "mimeType": {
      -                "description": "Detected MIME type of the file",
      -                "type": "string"
      -              },
      -              "modified": {
      -                "description": "Last modification timestamp after edits (ISO 8601 UTC)",
      -                "format": "date-time",
      -                "type": "string"
      -              },
      -              "path": {
      -                "description": "Resolved absolute path of the edited file",
      -                "type": "string"
      -              },
      -              "resourceUri": {
      -                "description": "Resource URI pointing to the updated file content; omitted when no edit matched (appliedEdits is 0) and the file was left untouched",
      -                "type": "string"
      -              },
      -              "size": {
      -                "description": "File size in bytes after edits",
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "unmatchedEdits": {
      -                "description": "oldText values that did not match any content in the file",
      -                "items": {
      -                  "type": "string"
      -                },
      -                "type": "array"
      -              }
      -            },
      -            "required": [
      -              "path",
      -              "size",
      -              "lineCount",
      -              "mimeType",
      -              "kind",
      -              "modified",
      -              "appliedEdits"
      -            ],
      -            "type": "object"
      -          }
      -        },
      -        "required": [
      -          "path"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "summary": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "failed": {
      -          "minimum": 0,
      -          "type": "integer"
      -        },
      -        "succeeded": {
      -          "minimum": 0,
      -          "type": "integer"
      -        },
      -        "total": {
      -          "minimum": 0,
      -          "type": "integer"
      -        }
      -      },
      -      "required": [
      -        "total",
      -        "succeeded",
      -        "failed"
      -      ],
      -      "type": "object"
      -    }
      -  },
      -  "required": [
      -    "results",
      -    "summary"
      -  ],
      -  "type": "object"
      -}New value: +null
  10. Changed27 schema fields changedv2.0.0
    • addedInput schema / $defs
      Added value: +{
      +  "EditSpec": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "newText": {
      +        "description": "Replacement text. Use an empty string to delete the matched oldText.",
      +        "type": "string"
      +      },
      +      "oldText": {
      +        "description": "Exact literal text to locate in the file. Must include 3-5 lines of context to ensure uniqueness and avoid matching the wrong block.",
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "oldText",
      +      "newText"
      +    ],
      +    "type": "object"
      +  }
      +}
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / oneOf
      Added value: +[
      +  {
      +    "required": [
      +      "path",
      +      "edits"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "files"
      +    ]
      +  }
      +]
    • changedInput schema / properties / dryRun / description
      Previous value: -"Preview edits without writing. Check `unmatchedEdits` in response."New value: +"Preview diffs without writing to disk (default: false = apply edits)"
    • changedInput schema / properties / edits / description
      Previous value: -"List of replacements to apply sequentially. Each edit replaces the first occurrence of oldText."New value: +"Replacements applied to path; not allowed when using files"
    • addedInput schema / properties / edits / items / $ref
      Added value: +"#/$defs/EditSpec"
    • removedInput schema / properties / edits / items / additionalProperties
      Removed value: -false
    • removedInput schema / properties / edits / items / properties
      Removed value: -{
      -  "newText": {
      -    "description": "Replacement string. Preserve surrounding indentation style.",
      -    "type": "string"
      -  },
      -  "oldText": {
      -    "description": "Exact literal string to replace (character-for-character). Include 3–5 lines of context for unique targeting.",
      -    "maxLength": 102400,
      -    "minLength": 1,
      -    "type": "string"
      -  }
      -}
    • removedInput schema / properties / edits / items / required
      Removed value: -[
      -  "oldText",
      -  "newText"
      -]
    • removedInput schema / properties / edits / items / type
      Removed value: -"object"
    • addedInput schema / properties / edits / maxItems
      Added value: +100
    • addedInput schema / properties / files
      Added value: +{
      +  "description": "Per-file entries (batch mode)",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "edits": {
      +        "description": "Replacements to apply to this specific file",
      +        "items": {
      +          "$ref": "#/$defs/EditSpec"
      +        },
      +        "maxItems": 100,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "path": {
      +        "description": "File or directory path inside an allowed workspace root.",
      +        "maxLength": 4096,
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "path",
      +      "edits"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 5,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • changedInput schema / properties / ignoreWhitespace / description
      Previous value: -"Treat all whitespace sequences as equivalent when matching oldText."New value: +"Ignore leading/trailing whitespace differences when matching oldText"
    • changedInput schema / properties / path / description
      Previous value: -"Absolute path to file or directory."New value: +"Single file path; mutually exclusive with files"
    • removedInput schema / required
      Removed value: -[
      -  "path",
      -  "edits"
      -]
    • removedOutput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedOutput schema / properties / appliedEdits
      Removed value: -{
      -  "maximum": 9007199254740991,
      -  "minimum": 0,
      -  "type": "integer"
      -}
    • removedOutput schema / properties / diff
      Removed value: -{
      -  "description": "Unified diff of changes (dryRun)",
      -  "type": "string"
      -}
    • removedOutput schema / properties / lineRange
      Removed value: -{
      -  "description": "Line range modified [start, end] (1-based)",
      -  "prefixItems": [
      -    {
      -      "maximum": 9007199254740991,
      -      "minimum": 1,
      -      "type": "integer"
      -    },
      -    {
      -      "maximum": 9007199254740991,
      -      "minimum": 1,
      -      "type": "integer"
      -    }
      -  ],
      -  "type": "array"
      -}
    • removedOutput schema / properties / linesAdded
      Removed value: -{
      -  "description": "Lines added",
      -  "maximum": 9007199254740991,
      -  "minimum": 0,
      -  "type": "integer"
      -}
    • removedOutput schema / properties / linesRemoved
      Removed value: -{
      -  "description": "Lines removed",
      -  "maximum": 9007199254740991,
      -  "minimum": 0,
      -  "type": "integer"
      -}
    • removedOutput schema / properties / ok
      Removed value: -{
      -  "type": "boolean"
      -}
    • removedOutput schema / properties / path
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / results
      Added value: +{
      +  "description": "Per-path edit results ordered to match the input paths",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "error": {
      +        "additionalProperties": false,
      +        "description": "Error details; present on failure",
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "message": {
      +            "type": "string"
      +          },
      +          "path": {
      +            "type": "string"
      +          },
      +          "suggestion": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "message"
      +        ],
      +        "type": "object"
      +      },
      +      "path": {
      +        "description": "Requested file path",
      +        "type": "string"
      +      },
      +      "value": {
      +        "additionalProperties": false,
      +        "description": "Edit result; present on success",
      +        "properties": {
      +          "appliedEdits": {
      +            "description": "Number of edits successfully applied",
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "diff": {
      +            "description": "Unified diff of all changes (present only in dryRun mode)",
      +            "type": "string"
      +          },
      +          "kind": {
      +            "description": "Broad file kind: text, binary, image, audio, or pdf",
      +            "enum": [
      +              "text",
      +              "binary",
      +              "image",
      +              "audio",
      +              "pdf"
      +            ],
      +            "type": "string"
      +          },
      +          "lineCount": {
      +            "description": "Number of lines in the file after edits",
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "lineRange": {
      +            "description": "Line range [firstLine, lastLine] covering all applied edits",
      +            "prefixItems": [
      +              {
      +                "exclusiveMinimum": 0,
      +                "type": "integer"
      +              },
      +              {
      +                "exclusiveMinimum": 0,
      +                "type": "integer"
      +              }
      +            ],
      +            "type": "array"
      +          },
      +          "linesAdded": {
      +            "description": "Net lines added by all applied edits",
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "linesRemoved": {
      +            "description": "Net lines removed by all applied edits",
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "mimeType": {
      +            "description": "Detected MIME type of the file",
      +            "type": "string"
      +          },
      +          "modified": {
      +            "description": "Last modification timestamp after edits (ISO 8601 UTC)",
      +            "format": "date-time",
      +            "type": "string"
      +          },
      +          "path": {
      +            "description": "Resolved absolute path of the edited file",
      +            "type": "string"
      +          },
      +          "resourceUri": {
      +            "description": "Resource URI pointing to the updated file content; omitted when no edit matched (appliedEdits is 0) and the file was left untouched",
      +            "type": "string"
      +          },
      +          "size": {
      +            "description": "File size in bytes after edits",
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "unmatchedEdits": {
      +            "description": "oldText values that did not match any content in the file",
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "path",
      +          "size",
      +          "lineCount",
      +          "mimeType",
      +          "kind",
      +          "modified",
      +          "appliedEdits"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "path"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / summary
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "failed": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "succeeded": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "total": {
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "total",
      +    "succeeded",
      +    "failed"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / properties / unmatchedEdits
      Removed value: -{
      -  "description": "Edits that could not be applied",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "ok"
      -]New value: +[
      +  "results",
      +  "summary"
      +]
  11. Addedv1.15.3
  12. Removedv1.15.0
  13. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the destructive/non-idempotent annotations, it discloses per-file all-or-nothing semantics, that other files still commit when one fails, dryRun's softer unmatched handling, the automatic whitespace-tolerant retry and its condition, failure modes (missing, binary, non-UTF-8, size cap with default), the return format, and the 30-minute undo id lifetime. This is unusually rich behavioral context that the annotations alone would not convey.

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 alternatives before behavior, and nearly every sentence carries distinct information. The paragraph is dense and a couple of clauses (size cap default, undo validity) could be tightened, but nothing is filler.

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?

For a destructive multi-file mutation with no output schema, the description covers failure modes, partial-success semantics, dry-run behavior, retry logic, return format, and undo availability. An agent has everything needed to call it correctly or decide not to.

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 already 100%, yet the description still adds cross-parameter meaning: the dryRun distinction between unmatched (reported) and ambiguous (fails), the auto retry interaction with ignoreWhitespace, and the 5-file cap. It does not explain the path-vs-files exclusivity here, but the schema handles that, so this is above the baseline rather than deficient.

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 resource ('Replace exact, unique text snippets in up to 5 existing text files') and immediately distinguishes itself from siblings by naming `replace_text`, `patch`, and `create`. An agent can route correctly 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 ('when you know the exact text to change'), an explicit when-not ('Do not use it for every match of a pattern'), and named alternatives for three distinct cases: pattern replacement, unified diffs, and new-file creation.

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