Skip to main content
Glama
claucloverleaf

claucloverleaf

by SolthaX

overleaf_replace_lines

Destructive

Replace or delete a specified line range in an Overleaf project file; re-read the file first because line numbers shift after edits.

Instructions

Replace (or delete) a range of lines. Re-read the file first: line numbers move.

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>",
      "start_line": "<start_line>",
      "end_line": "<end_line>",
      "content": "<content>"
    },
    "name": "overleaf_replace_lines"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath in the project, e.g. 'main.tex' or 'chapters/intro.tex'.
contentYesReplacement lines; empty string deletes the range.
projectYesProject id, Overleaf project URL, or exact project name.
end_lineYesLast line to replace (inclusive).
start_lineYesFirst line to replace (1-based).
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.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the safety profile is covered. The description earns credit beyond that by warning that line numbers shift and the file must be re-read, a genuine operational hazard not expressed in any structured field. It still omits what happens on out-of-range indices or whether edits are atomic.

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?

Two short sentences, zero filler, with the action stated first and the caveat immediately after. Nothing could be removed without losing information.

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, so return values need not be explained, and the annotations carry the destructive profile. What remains missing is sibling routing among the text/line edit tools, which matters given six sibling alternatives in this family.

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 every parameter including track_changes and the empty-string deletion convention is already documented in the schema. The description adds no parameter-level meaning beyond that baseline.

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 resource: 'Replace (or delete) a range of lines.' That precision contrasts with siblings like overleaf_replace_text and overleaf_insert_lines, though it never names them explicitly.

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?

It gives one concrete prerequisite, 'Re-read the file first: line numbers move,' which is real usage guidance. However, it says nothing about choosing this over overleaf_replace_text (text match) or overleaf_insert_lines (no replacement), leaving the key sibling choice to inference.

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