Skip to main content
Glama

Edit

edit
Destructive

Replace an exact text match in a file once or globally while preserving encoding and newline style, then return a unified diff to verify the change.

Instructions

Replace exact text in a file. oldString must match exactly once unless replaceAll=true. The file's encoding and newline style are preserved. Returns a unified diff.

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>",
      "oldString": "<oldString>",
      "newString": "<newString>"
    },
    "name": "edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
newStringYes
oldStringYes
replaceAllNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, but the description adds real value beyond them: the uniqueness requirement on the match, encoding and newline preservation, and that a unified diff is returned. It does not say what happens on zero or multiple matches beyond implying failure, which is the main remaining gap.

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 critical matching constraint, then the side effects and return value. No wasted wording.

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 destructive four-parameter mutation, the description covers the match constraint, side effects on formatting, and the return type (a unified diff), with an output schema also present. Minor omissions are failure modes such as missing file or ambiguous match handling.

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 0% schema description coverage, the description must carry parameter meaning and it largely does: it explains the exact-match-once semantics of oldString, the role of replaceAll, and the implied roles of path and newString. It could be sharper on newString behavior but the essential semantics are covered.

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: 'Replace exact text in a file.' That is clearly distinct from read/grep/write, though it does not explicitly separate itself from the sibling 'patch', which likely performs a similar edit operation.

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 gives an operational constraint ('oldString must match exactly once unless replaceAll=true') but never says when to choose this tool over 'patch' or 'write'. Usage is implied rather than stated.

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

Deploy Server

Other Tools