Skip to content

read_file

Use read_file to inspect an existing model, run.py, README, or data seed before making changes

read-only · idempotent

NameTypeRequiredDefaultDescription
project_nameAnnotated[str, Field(description='Name of the Bridge Town project.')]Yes
pathAnnotated[str, Field(description="Project-relative file path to read (e.g. 'run.py', 'model/revenue.py').")]Yes
encodingAnnotated[Literal['auto', 'text', 'base64'], Field(description="How to decode the file: 'auto' (default) sniffs binary vs text; 'text' returns UTF-8 string; 'base64' returns base64-encoded bytes.")]No'auto'
branch`Annotated[strNone, Field(description=“Branch to operate on. Defaults to the project’s default branch when omitted or null.”)]`NoNone

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.

{
"name": "read_file",
"arguments": {
"project_name": "forecasts",
"path": "model/revenue.py"
}
}
{
"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.