Read a file from the open Overleaf project
read_fileAccess file contents in an Overleaf project by relative path, receiving full text for text documents or base64 for binaries, plus metadata on version, lines, and tracked changes.
Instructions
Reads the contents of a file by project-relative path. For text docs (.tex, .bib, .md, etc.) the full text appears in both the content array and structuredContent.text; metadata (version, line/byte counts, ranges, tracked-change/comment counts) is in structuredContent. For binary files (images, PDFs) base64 is in content and structuredContent.base64, with MIME type alongside.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Project-relative path of the file, e.g. 'main.tex' or 'chapters/intro.tex'. If omitted, defaults to the project's root doc (visible as `root_doc_path` in `open_project`'s response). |