Read File
read_fileRead a file from a Floot project (cat -n style). Paths follow the item scheme: components/Name.tsx, components/Name.module.css, helpers/Name.tsx, pages/name.tsx, pages/name.pageLayout.tsx, endpoints/route_POST.ts, endpoints/route_POST.schema.ts, static/file.txt, base.css. Use offset/limit for large files. Pass include_references:true to also list which project files reference this one (static import graph plus queueTask/runCode name references and, for endpoints, URL-path string usage) — check it before renaming or deleting a file, or use rename_file which rewrites importers itself. Hosted assets are readable too: pass the project-relative asset path (/_cdn/, as returned by upload_asset / generate_image or used in the app's ; private/ for private storage) and a png/jpeg/gif/webp image is returned as an image you can see (≤3.75 MB), text-typed assets as text, other binaries as a size/type summary. A read does not typecheck by default: pass diagnostics:"auto" to append a .ts/.tsx file's CURRENT type errors when the project's compute VM is already warm (so you see latent errors before editing), or "wait" to boot the VM and force the check. older_than walks the file's HISTORY: pass "current" to see the file as it was just before its latest change, then the cursor from that result to step one change further back — use it when something used to work and you want to compare or restore an earlier version (write the old content back with write_file).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| limit | No | ||
| offset | No | ||
| projectId | Yes | ||
| older_than | No | Omit (or leave empty) to read the current file. Set it only to read the file as it was BEFORE an earlier change. Pass "current" for the version just before the latest change to it, then the cursor each result gives you to step one change further back — until you find a good version, then write it back with write_file (or merge by hand). Not a version number: each step is one recorded change to the file. Type errors and references are skipped for past versions. | |
| diagnostics | No | ||
| include_references | No |