Skip to main content
Glama

manage_history

Destructive

Create labeled checkpoints before large edits or restore a document to an earlier version by label or version, with path confirmation to prevent accidental overwrites.

Instructions

Label the project's current version as a checkpoint, or restore one document to an earlier version. create_label takes comment, 1 to 1000 characters, and labels the version current just before the call; create one before a large edit, so the version before it can be found again. It returns label { id, comment, version, createdAt } and verified (the label was read back). restore_file takes filePath, version or labelId, and confirmPath equal to filePath, else CONFIRMATION_MISMATCH and nothing is sent. filePath is the path the document had at that version; one the version lacks is NOT_FOUND, and a binary file INVALID_ARGUMENT with details.kind binary_file, before anything is sent. Overleaf deletes the live file and creates a new document with that version's text, tracked changes, and comments, so changes and comments made since are gone, comment threads get new ids, the document gets a new docId, and every revision of the old one stops working; a root document stays the root. It returns filePath, version, docId, previousDocId (null when nothing was at the path), the new document's revision, protocol, trackChangesActive, and contentMatches (its text equals what read_file_version reads). Nothing is retried: a lost or failed answer is read back, giving recoveredAfterTimeout: true when it applied, REMOTE_ERROR with details.outcome not_applied when Overleaf failed it and nothing changed, and otherwise OUTCOME_UNKNOWN: read the history or the tree before acting again.

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": {
      "projectId": "<projectId>",
      "action": "<action>"
    },
    "name": "manage_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionYes
commentNocreate_label: what the checkpoint marks
labelIdNorestore_file: the label whose version to restore
versionNorestore_file: the version to restore; or pass labelId
filePathNorestore_file: the document, as named at that version
projectIdYesOverleaf project ID
confirmPathNorestore_file: must equal filePath

Output Schema

NameRequiredDescriptionDefault
docIdNo
labelNo
actionYes
versionNo
filePathNo
protocolNo
revisionNo
verifiedNo
previousDocIdNo
contentMatchesNo
trackChangesActiveNo
recoveredAfterTimeoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.1

TDQS

A4.6/5.0
Behavior5/5

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

Far exceeds the annotations: it discloses that restore deletes the live file and creates a new document, that changes and comments since are lost, that comment threads get new ids, that docId changes and old revisions stop working, and that a root document stays root. It also documents the no-retry policy with the three outcome states (recoveredAfterTimeout, REMOTE_ERROR/not_applied, OUTCOME_UNKNOWN) and the error codes NOT_FOUND, INVALID_ARGUMENT (details.kind binary_file) and CONFIRMATION_MISMATCH. This is consistent with destructiveHint=true and idempotentHint=false.

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?

Purpose is front-loaded in the first sentence and the paragraph then splits into a create_label block and a restore_file block, each self-contained. It is dense and a bulleted layout would scan faster, but nearly every clause carries load-bearing information (error codes, return fields, id semantics).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, multi-action tool with 7 parameters and two distinct code paths, the description covers purpose, per-action parameters, return shapes for both actions, failure modes, and retry/read-back semantics. An output schema exists so return values are optional detail, yet their inclusion removes any ambiguity about what changed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 86%, so the baseline is 3, but the description adds real meaning: filePath is the path the document had *at that version* (a version lacking that path is NOT_FOUND), and version/labelId are presented as mutually alternative selectors. The confirmPath guard and comment length restate schema facts but reinforce their purpose.

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?

Opens with two specific verb+resource pairs — labeling the current version as a checkpoint and restoring one document to an earlier version — and immediately binds each to its action value (create_label, restore_file). The scope word 'one document' and 'current version' distinguishes it from read_file_version and monitor_project_history.

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

Usage Guidelines4/5

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

Gives explicit when-to guidance for create_label ('create one before a large edit, so the version before it can be found again') and, for restore_file, states the precondition that confirmPath must match and that a mismatch sends nothing. It also tells the agent to read the history or tree before retrying after OUTCOME_UNKNOWN. It stops short of naming a sibling tool as the alternative for inspecting versions first, so it is not a full 5.

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