Skip to main content
Glama

Edit a file

edit_file

Apply exact search-and-replace edits to Overleaf files, merging live collaborator typing instead of overwriting it; optionally record edits as tracked changes.

Instructions

Applies exact search-and-replace edits to a file, live: collaborators see the change instantly and concurrent typing is merged, not overwritten. All edits apply together or not at all. With suggest=true the edits become tracked changes the author can accept or reject in Overleaf's review panel.

Input Schema

NameRequiredDescriptionDefault
pathYes
editsYesApplied in order, each to the result of the previous one
dryRunNoShow the diff without changing anything
projectNoProject name, id or Overleaf URL. May be omitted when exactly one project is pinned.
suggestNoRecord as tracked changes (suggestions) instead of direct edits

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.1

TDQS

A3.7/5.0
Behavior5/5

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

Annotations only declare openWorldHint and destructiveHint=false, yet the description adds substantial behavioral context: live multi-collaborator visibility, merge-not-overwrite concurrency semantics, atomic all-or-nothing application, and the tracked-change/review flow under suggest=true. These are meaningful traits an agent could not infer from the annotations alone.

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 sentences that lead with the core action and then layer behavior and the suggest mode. Front-loaded and largely waste-free, though the first sentence is dense with clauses.

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?

No output schema and only partial annotation coverage, so the description carries the behavioral burden well — atomicity, live merge, and suggestion semantics are all present. It omits auth/pinning expectations and the meaning of dryRun, but for a well-schema'd mutation tool this is close to complete.

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 80%, so the schema already documents oldText/newText/replaceAll/dryRun/project. The description adds meaning for suggest (tracked changes vs. direct edits) but says nothing about dryRun, replaceAll, or the pinned-project omission rule. Baseline 3 is appropriate when the schema carries most parameter semantics.

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?

The description states a specific verb and mechanism: 'Applies exact search-and-replace edits to a file.' This clearly separates it from whole-file writers like write_file by the search-and-replace mechanic, though it never names that sibling explicitly, so the differentiation is implied rather than stated.

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

Usage Guidelines2/5

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

There is no explicit when-to-use guidance and no comparison to alternatives such as write_file or the suggest-mode review flow vs. direct edits. 'With suggest=true...' describes a mode's effect but not the condition under which an agent should choose it over a direct edit.

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