Skip to main content
Glama

Read a project file

read_file
Read-only

Read a file live from an Overleaf project, including collaborators' unsaved typing, with optional line ranges and line numbers. Returns images as images; read-only.

Instructions

Reads a file live from Overleaf (always the latest content, including collaborators' unsaved typing). Optionally a line range. Images (png/jpg/gif/webp) are returned as images. Read-only. To read one section by its title use get_section; for other binary files use download_file.

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": {
      "path": "<path>"
    },
    "name": "read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile path inside the project, e.g. "main.tex" or "sections/intro.tex"
endLineNoLast line to return, inclusive (default: the last line)
projectNoProject name, id or Overleaf URL. May be omitted when exactly one project is pinned.
startLineNoFirst line to return, counting from 1 (default: the first line)
lineNumbersNoPrefix lines with their numbers (do not copy these into edits)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.1.4
    • addedInput schema / properties / endLine / description
      Added value: +"Last line to return, inclusive (default: the last line)"
    • addedInput schema / properties / startLine / description
      Added value: +"First line to return, counting from 1 (default: the first line)"
  2. First observedv2.1.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, and the description is consistent with them while adding genuinely new behavior: content is fetched live including collaborators' unsaved typing, and image types are returned as images rather than text. It does not cover failure modes (missing path, ambiguous project) or what the text response looks like, which keeps it short of a 5.

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?

Three short sentences, front-loaded with the live-read behavior that distinguishes this tool, followed by options then sibling routing. No sentence is redundant with another.

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

Completeness4/5

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

With no output schema, the description carries the return-format burden and does address image returns and line ranges. It is adequate for a simple read tool, though it is silent on error behavior and on whether text responses include metadata alongside content.

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 the baseline is 3. The description only adds 'optionally a line range', which maps to startLine/endLine but adds no syntax or boundary semantics; lineNumbers and the project-omission rule are left entirely to the schema.

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 and resource (reads a file) and immediately qualifies it with live Overleaf content semantics. It explicitly separates itself from get_section (section-by-title reads) and download_file (other binary files), so an agent can route correctly without opening any schema.

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

Usage Guidelines5/5

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

Provides explicit alternatives with their selecting conditions: use get_section for a section by title, use download_file for other binary files. It also states the line-range option, which is the main usage variant. Little is left to inference.

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