Skip to main content
Glama

read_file

Read-only

Reads a text document as LF-normalized content and returns its revision token for use in write operations, letting you edit Overleaf files safely.

Instructions

Read a text document as LF-normalized content and return its opaque revision. Returns content, revision (pass it unchanged to write_file or write_section), newline "LF", protocol ("sharejs" or "history-ot"), and trackChangesActive.

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"
  }
}

Input Schema

NameRequiredDescriptionDefault
filePathYesProject-relative path using forward slashes
projectIdYesOverleaf project ID

Output Schema

NameRequiredDescriptionDefault
contentYes
newlineYes
protocolYes
revisionYes
trackChangesActiveYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, and the description is consistent with a pure read. It goes beyond annotations by disclosing the LF normalization guarantee, the opacity of the revision token (mutually reinforcing that it must be passed back unchanged), and the protocol/trackChangesActive fields, which tell the agent what mode the document is in. Missing are failure behavior (e.g. nonexistent path) and any note that reading has no side effects on revision history.

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 sentences, front-loaded with the core action and followed by the enumerated return shape. Every clause carries information; nothing is padding.

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?

With only two parameters and an existing output schema, the definition is nearly sufficient, but the return-field list partly duplicates the output schema while omitting selection guidance against sibling readers. For a tool whose main risk is picking the wrong reader, that gap matters more than the duplicated return description.

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

Parameters5/5

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

Schema description coverage is 100%, so projectId and filePath are already fully documented in the input schema, and the description adds no param detail that is needed. It does not mislead about parameters.

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 names a specific verb and resource ('Read a text document') and adds a meaningful qualifier ('LF-normalized content') plus the revision token it yields. It is clear what the tool does, but it does not explicitly distinguish itself from likely-overlapping siblings such as get_full_document or get_section_content.

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?

Usage is implied rather than stated: mentioning that the revision must be passed 'unchanged to write_file or write_section' sketches a read-modify-write workflow. There is no explicit when-not guidance and no direct statement of when to prefer this over get_full_document or download_file, so the agent must infer.

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