Read a project file
read_fileRead 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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path inside the project, e.g. "main.tex" or "sections/intro.tex" | |
| endLine | No | Last line to return, inclusive (default: the last line) | |
| project | No | Project name, id or Overleaf URL. May be omitted when exactly one project is pinned. | |
| startLine | No | First line to return, counting from 1 (default: the first line) | |
| lineNumbers | No | Prefix lines with their numbers (do not copy these into edits) |