Skip to main content
Glama

apply_edits

Apply multiple find-and-replace edits to one Overleaf file as a single change; all edits succeed or none are applied.

Instructions

Apply several find/replace edits to one file as a single Overleaf change.

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>",
      "edits": "<edits>"
    },
    "name": "apply_edits"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile to edit, relative to the project root.
editsYesEdits applied in order; each sees the result of the previous one. All succeed or none are applied.
messageNoCommit message shown in Overleaf's history.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, and openWorldHint=true, so the safety profile is partly covered. The description contributes real behavioral context by stating the edits land as one Overleaf change, i.e. grouped into a single history entry. It says nothing about what happens when old_text is not found, permission requirements, or whether the change is visible to collaborators immediately.

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?

A single front-loaded sentence with no filler; the operation, the granularity (one file), and the atomicity are all packed in without redundancy.

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 mutation tool with no output schema, the definition covers the essentials (target file, batching, single change) but omits meaningful behavior: what failure looks like when a match is missing, and whether the change is pushed to Overleaf immediately given the presence of push_changes as a sibling. Adequate but with clear gaps an agent would want closed.

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 path, edits, replace_all, and message are already documented, including the ordered application and all-or-nothing semantics. The description adds no parameter-level meaning beyond what the schema states, which is the baseline expectation when coverage is complete.

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 gives a specific verb and resource ('apply several find/replace edits to one file') plus a scope qualifier ('as a single Overleaf change'), which clearly distinguishes it from bulk or whole-file operations. It stops short of naming the obvious sibling (edit_file) for the single-edit case, so the boundary 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 Guidelines3/5

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

The phrase 'several edits ... to one file' implies the intended situation (multiple replacements in a single file), but there is no explicit when-to-use or when-not-to-use guidance. An agent must infer that this is preferred over edit_file or write_file for multi-edit batches.

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