Skip to main content
Glama

read_file_version

Read-only

Read a document's text at an earlier Overleaf project version by version or label to inspect history without modifying the project.

Instructions

Read the text a document held at an earlier project version, from Overleaf's history; nothing changes. Pass version (from monitor_project_history: an update's toVersion is the version after it, its fromVersion the one before) or labelId (a label from monitor_project_history or manage_history). filePath is the path the document had at that version. Returns filePath, version, content (LF-normalized), and newline "LF", with no revision: to put the text back, use manage_history restore_file, or write it with write_file against a fresh read_file revision. A path the version lacks, or an unknown labelId, is NOT_FOUND; a binary file is INVALID_ARGUMENT with details.kind binary_file, and a version past the current one INVALID_ARGUMENT with details.kind version_ahead.

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>",
      "filePath": "<filePath>"
    },
    "name": "read_file_version"
  }
}

Input Schema

NameRequiredDescriptionDefault
labelIdNoLabel whose version to read; or pass version
versionNoProject version to read; or pass labelId
filePathYesProject-relative path using forward slashes
projectIdYesOverleaf project ID

Output Schema

NameRequiredDescriptionDefault
contentYes
newlineYes
versionYes
filePathYes

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?

Annotations only declare readOnlyHint=true, and the description corroborates rather than repeats it while adding real behavior: the returned fields, LF normalization and newline reporting, the absence of a revision handle, and two distinct INVALID_ARGUMENT subtypes (binary_file, version_ahead) plus NOT_FOUND conditions. That is exactly the error/auth detail an agent needs before calling.

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?

Front-loaded with purpose and the read-only guarantee, then selector semantics, then return shape, then error taxonomy — a sensible ordering with no filler. It is a single dense run-on paragraph, which slightly hurts scannability.

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?

With an output schema present the description need not restate return values, yet it still flags the LF normalization and missing revision handle, and it covers the failure modes an agent must handle. Nothing needed to invoke or recover from this call correctly is missing.

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 100%, so the bar is the baseline 3, and the description exceeds it by explaining how to derive version from monitor_project_history and clarifying that filePath is 'the path the document had at that version' rather than the current path — a non-obvious semantic the schema does not convey.

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?

States a specific verb+resource+scope: 'Read the text a document held at an earlier project version, from Overleaf's history; nothing changes.' This clearly separates it from read_file (current text) and from manage_history (which mutates), so an agent can pick it without opening the schema.

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 provenance for the two selector params ('from monitor_project_history: an update's toVersion is the version after it, its fromVersion the one before', 'a label from monitor_project_history or manage_history') and names the right alternatives for the write-back case (manage_history restore_file, write_file against a fresh read_file revision). It never states the inverse exclusion ('for the current text use read_file'), which keeps it from a 5.

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