files_read
Read a text file from the workspace.
Returns the contents of a file in /workspace as text.
Inputs
| Name | Type | Default | Allowed values | Description |
|---|---|---|---|---|
sessionIdrequired | string | – | – | The session's id, from session_create. |
pathrequired | string | – | – | The file, relative to /workspace. |
sessionId is the id that session_create returned. The server keeps no default session. This tool works on the session as it is, running or stopped, and does not resume it first.
Example call
This is what an MCP client sends. You do not write it yourself: ask the model in plain words and it calls the tool.
{ "name": "files_read", "arguments": { "sessionId": "6c1f3c9e-1d2a-4f67-9b0e-1b2c3d4e5f60", "path": "downloads/report.csv" }}What it returns
The file's text.
date,amount2026-09-01,120.00…When a call fails, the result is marked as an error. Its text starts with the API’s error code, such as unauthorized or session_not_running, followed by its message.
Annotations
The server tells every client what this tool does to the world, so a client can decide what to ask you about before it runs.
| Annotation | Value |
|---|---|
title | Read a file |
readOnlyHint | true |
destructiveHint | false |
openWorldHint | false |
Good to know
- Long files are cut at 40,000 characters. Use it for text files only.
- It works on a stopped session too: it reads the files the session saved when it stopped, without starting a machine. If the session saved nothing, the call fails with
nothing_saved.
The same thing with the API
| Endpoint | Reference |
|---|---|
GET /v1/sessions/{id}/files | Read a file or list a folder |
These docs describe a beta API. Endpoints, fields and SDK methods may change before general availability; breaking changes will be listed in the changelog.