read_file
Read the contents of any file from a Bridge Town project. The path is project-relative (e.g. ‘README.md’, ‘model/revenue.py’, ‘data/seed.csv’, ‘assets/logo.png’). Specify branch to read from a non-default branch (e.g. a scenario branch). Omitting branch, passing an empty string, or passing null all resolve to the project’s default branch. Passing the branch name explicitly is equivalent. encoding controls how the file is returned: ‘auto’ sniffs the file and returns ‘text’ for UTF-8 or ‘base64’ for binary; ‘text’ always decodes as UTF-8; ‘base64’ always returns base64-encoded bytes. Returns: path (str) — file path; project (str) — project name; content (str) — file content (text or base64); encoding (str) — ‘text’ or ‘base64’; sha (str) — blob SHA for optimistic concurrency control (pass as expected_sha to update_file or delete_file); size_bytes (int) — raw byte size of the file.
read-only · idempotent
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
project_name | str | Yes | — | |
path | str | Yes | — | |
encoding | str | No | 'auto' | |
branch | `str | None` | No | None |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
path(string)project(string)content(string)encoding(string)sha(string)size_bytes(integer)
See the response example below for the full payload shape.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "read_file", "arguments": { "project_name": "forecasts", "path": "model/revenue.py" }}Response
Section titled “Response”{ "path": "model/revenue.py", "project": "forecasts", "content": "import pandas as pd\n\ndef run(inputs):\n ...\n", "encoding": "text", "sha": "abc1234def5678901234567890abcdef12345678", "size_bytes": 482}- Module:
Models - Requires authentication via API token or Auth0 JWT.