What it does
The Read File tool lets an agent open and read a single file from anywhere it already has access: a file in its Python sandbox, a conversation attachment (user-uploaded or tool-generated), a knowledge-base file, or a URL. It’s the agent equivalent of a coding assistant’s “Read” primitive — a safe, read-only way to pull a specific file into context on demand.Read File is pre-checked when you create an agent in the Control Hub. It’s a read-only baseline that can only reach files the agent could already access, so new agents start with it enabled. It behaves like any other tool — you can uncheck it at any time. See Default-on tools.
Key features
- Four sources, one tool — sandbox paths,
attachment:<filename>,kb:<file_id>, andhttps://…URLs - Documents auto-extract to text — PDF, DOCX, XLSX, PPTX, CSV, EML, and MSG are converted automatically
- Images come back as vision — PNG/JPG/GIF/WebP are returned as images the agent can visually analyze (charts, screenshots, diagrams, scans); oversized images are auto-downscaled
- Line pagination — all text is paginated with
offset/limitso large files never overflow context - PDF page images — read a PDF as page images (not just text) to reason over layout, charts, and scanned content
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | What to read: a sandbox path (absolute or relative to /home/user), attachment:<filename>, kb:<file_id>, or an https://… URL |
offset | integer | No | Where to start — a 1-based line for text, or a 1-based page when mode: image. For paging large files (default: 1) |
limit | integer | No | How much to return — max lines of text (default 2000), or max pages in image mode. The result reports the total and the next offset when more remains |
mode | string | No | For PDFs and knowledge-base files: text (extracted text, default), image (page images for visual analysis), or both. Ignored for plain images (always vision) and plain text (always text) |
Common use cases
Read a conversation attachment
Read a specific knowledge-base file
Look at a PDF’s pages as images
Read a sandbox file
Image support depends on the model
Returning an image from a tool requires a model whose provider can receive tool-result images as real vision:- Supported: Anthropic, OpenAI, Azure OpenAI, and Google (Gemini).
- Text-only: xAI (Grok). On xAI, image/both requests are automatically downgraded to text (with a note), and image-only files return an error suggesting an Anthropic, OpenAI, Azure, or Google model.
Limitations
- Reads one file per call (use a separate call per file)
- Very large images are rejected; oversized readable images are downscaled
- Image and PDF-page-image output requires a vision-capable provider (see above)
- Non-PDF Office documents (DOCX/XLSX/PPTX/CSV/email) are text-only — no page images
Related tools
- Scrape URL — extract content from web pages and PDFs by URL
- Search Knowledge Base — semantic search across a knowledge base (vs. reading one known file)
- Execute Python — process files programmatically in the sandbox
