Read a file from the open Overleaf project
read_fileRead file contents by relative path from an Overleaf project. Supports text files with full content and metadata, and binary files with base64 encoding and MIME type. Defaults to the project's root document if no path is specified.
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). |