Skip to main content
Glama

edit_file

Replace one exact snippet inside an existing file, leaving the rest byte-for-byte untouched. Prefer this over write_file for any change to a file that already exists. old_string must appear exactly once — include enough surrounding lines to make it unique — and must be copied verbatim from read_file, including indentation.

Input Schema

NameRequiredDescriptionDefault
pathYes
new_stringYes
old_stringYes
project_idYes
descriptionNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does well: it discloses the non-destructive scoping guarantee and the hard pre-condition that old_string 'must appear exactly once' and be copied verbatim from read_file. It stops short of describing failure behavior (what error occurs on non-unique match) or permission requirements, which keeps it from a 5.

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 dense sentences, workload front-loaded with the core behavior before routing advice and the critical constraint. No filler.

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?

An output schema exists, so return-value explanation is unnecessary, and the description covers the scoping and uniqueness semantics an agent needs to call it correctly. Missing only edge-case behavior (non-unique match handling, permissions), a minor gap for a well-scoped edit tool.

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 coverage is 0%, so the description must compensate. It richly documents old_string (uniqueness, verbatim copy, indentation) and implies new_string, but leaves path, project_id, and description undocumented. It covers the highest-risk parameters but not the full 5-param surface.

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 precise verb ('Replace one exact snippet') and resource ('inside an existing file') with an explicit scope guarantee ('leaving the rest byte-for-byte untouched'). An agent can immediately distinguish it from write_file and append_to_file without opening the 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?

Explicitly names the alternative and the condition that selects it: 'Prefer this over write_file for any change to a file that already exists.' This is a direct when-to-use/which-sibling routing instruction.

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