Read canvas files
read_filesRead canonical TSX and full-file SHA-256 contentHash for canvas frames, or the project's repository (bloom:devbox/repo/ in the live checkout, bloom:repo/ committed). Canvas entries include stable JSX sourcePath locators (50 per page; continue with elementsCursor and the same query), truncatedElementsCount, kind, importedFrameIds, openCommentThreads, theme (the layout the frame renders inside, picked or automatic, and its mode), and page ID/name. A bloom:file/ path that is no frame reads a text file (a stylesheet, JSON). Batches may span pages. Repository reads address the project's repository: when the client's local checkout is that repository, a path reads the same file there, and a frame imports it by that bloom:devbox/repo/ path instead of copying it. Canvas entries also carry the checks on exactly that source: typeStatus, typeCheck with lint, and runtimeCost, which is ran with over-budget rules, values and budgets, or unavailable when no browse_frame call recorded one. Each entry may take startLine/endLine (1-based, inclusive) or find (only the lines containing that text, as matches); every success reports totalLines for the whole file. A find or line-range read leaves out element locators (elementsOmitted; pass query to get them). The envelope's verification lists the batch's own frames; otherFilesWithErrors counts the rest of the branch's failing files. To read any file as it was at a version, prefix its path with the version: bloom:file@/ (the snapshotVersionId a message's acceptedCanvasVersionId or submittedCanvasContext names). The answer is that version's file even after a rename, a move or a reuse of the path; a folder path returns its children as JSON with nextCursor (pass it back as cursor); a blob returns its name, type, size and a read URL. Version paths are read-only: every mutating tool rejects them with PROJECT_VFS_VERSION_READ_ONLY. Arguments take the shape { files: [{ path }] }. Scope: project:read.
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": {
"files": "<files>"
},
"name": "read_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | Frames or sandbox files to read. Each result carries the full-file `contentHash` — pass it back as a `write_files` entry's `basis` — and `totalLines`, the full file's line count, so a ranged read knows where the file ends. | |
| branchId | No | Target branch id. Omit it — Bloom derives the branch from the frames you name, from the token's narrowing, or from your only readable branch, and enumerates the candidates if it genuinely cannot. |