> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://platform.bctrl.ai/_mcp/server.

# Read text

> Read bounded UTF-8 text from a durable File.

Read a bounded UTF-8 text slice from a durable File. Use this when an
automation flow needs text content without downloading the entire File.

## Read a File

```ts
const result = await bctrl.tools.call("files.read_text", {
  fileId: "file_01JQXYZ8ABCD1234EFGH5678JK",
  maxBytes: 262144,
  maxLines: 10000,
});

console.log(result.text);
console.log(result.truncated);
```

This Tool is synchronous and is not Runtime-bound. Use
`bctrl.files.content(fileId)` when you need the complete binary content.

## Request parameters

| Parameter  | Type      | Required | Description                                             |
| ---------- | --------- | -------- | ------------------------------------------------------- |
| `fileId`   | `FileId`  | Yes      | Durable File to read.                                   |
| `maxBytes` | `integer` | No       | Maximum bytes. Defaults to `262144`; maximum `1048576`. |
| `maxLines` | `integer` | No       | Maximum lines. Defaults to `10000`; maximum `50000`.    |

## Response

| Field       | Type      | Always present | Description                                |
| ----------- | --------- | -------------- | ------------------------------------------ |
| `fileId`    | `FileId`  | Yes            | File that was read.                        |
| `text`      | `string`  | Yes            | UTF-8 text returned by the Tool.           |
| `bytes`     | `number`  | Yes            | Number of bytes returned.                  |
| `lines`     | `number`  | Yes            | Number of lines returned.                  |
| `truncated` | `boolean` | Yes            | Whether either limit truncated the result. |

## Next

* [Files](/sdk/files) — upload, download, and manage durable Files
* [List files](/sdk/tools/files/files-list) — browse safe File metadata
* [Stage Runtime file](/sdk/tools/runtime/runtime-files-stage) — copy a File into a workspace