Skip to main content
Glama

edit

Apply targeted text replacements to a single file. Match unique, non-overlapping regions of the original text and supply new text to modify the file in place.

Instructions

Edit a single file using exact text replacement. Every edits[].oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit instead of emitting overlapping edits. Do not include large unchanged regions just to connect distant changes.

Input Schema

NameRequiredDescriptionDefault
pathYesPath to the file to edit (relative or absolute)
editsYesOne or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses that edits are matched against the original file rather than incrementally, and that oldText must be unique and non-overlapping — real behavioral context. However, it says nothing about failure behavior, atomicity, or what happens if a match is not found, which matters for a mutation 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?

Three tight sentences, front-loaded with the core action and followed by the constraints an agent most often gets wrong. Dense but each sentence addresses a real failure mode; no filler.

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 write tool with no annotations and no output schema, the description covers the matching semantics well but leaves gaps around error/failure reporting and permission requirements. Adequate but not complete for a mutation operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both parameters are already documented in the schema, including the uniqueness/non-overlap constraint on oldText. The description largely restates those constraints rather than adding new meaning beyond 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?

States a specific verb and resource ('Edit a single file') plus the mechanism ('exact text replacement'), which distinguishes it from the sibling 'write' tool that presumably replaces whole files. It stops short of naming 'write' explicitly, so differentiation requires some inference.

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 constraints ('merge overlapping edits', 'do not include large unchanged regions') imply the intended use case for targeted edits, but there is no explicit statement of when to choose edit over write, read, or bash. 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