Skip to main content
Glama
claucloverleaf

claucloverleaf

by SolthaX

overleaf_replace_text

Destructive

Replace an exact snippet in an Overleaf project file to make targeted edits, optionally replacing every occurrence or submitting as a tracked change.

Instructions

Replace an exact snippet of a document — the preferred way to make targeted edits.

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": {
      "project": "<project>",
      "path": "<path>",
      "old_text": "<old_text>",
      "new_text": "<new_text>"
    },
    "name": "overleaf_replace_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath in the project, e.g. 'main.tex' or 'chapters/intro.tex'.
projectYesProject id, Overleaf project URL, or exact project name.
new_textYesReplacement text (may be empty to delete).
old_textYesExact text to replace; must be unique unless replace_all.
replace_allNoReplace every occurrence.
track_changesNoSubmit as a tracked change (suggestion) instead of a direct edit.

Output Schema

NameRequiredDescriptionDefault
resultYes

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 destructiveHint=true, openWorldHint=true and readOnlyHint=false, so the mutation profile is covered. The description adds the 'exact snippet' framing but does not disclose failure behavior when old_text is missing or non-unique, nor what track_changes produces as a suggestion — meaningful gaps for a destructive edit tool, though the lower bar applies since annotations exist.

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 short sentence with the operation front-loaded and zero filler. Nothing could be removed without losing the recommendation it carries.

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?

An output schema exists and the schema documents all parameters, so much of the burden is carried elsewhere. Still, for a destructive six-parameter mutation tool, the description says nothing about failure modes (no match, ambiguous match) or the tracked-change workflow, leaving real operator-relevant context absent.

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 all six parameters including replace_all and track_changes are already documented in the schema, establishing the baseline of 3. The description's 'exact snippet' wording reinforces the old_text uniqueness semantics but contributes no new parameter meaning.

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 an exact snippet of a document'. The phrase 'exact snippet' and 'targeted edits' implicitly distinguishes it from whole-file writes and line-based edits, but no sibling (overleaf_replace_lines, overleaf_write_file) is named, so differentiation is left partly to 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 clause 'the preferred way to make targeted edits' gives real guidance that this should be chosen over broader write operations for small changes. However, it never names the alternatives (write_file, replace_lines, insert_lines) or states when not to use it, so an agent must infer the routing decision.

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