Read a file from a sandbox
read_fileRetrieve a sandbox file's contents (up to 5 MiB) as UTF-8 or Base64 for inspection or processing. Paths must resolve under /home/user or /tmp.
Instructions
Read a file from a sandbox. Files up to 5 MiB. For a larger file, use POST /sandboxes/{sandboxId}/files/download-url. On a sandbox that is still starting, the call waits until it is ready (up to 60 s, like a command), so it reads the sandbox's own disk and never the machine's stock one.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sandboxId": "<sandboxId>",
"path": "<path>"
},
"name": "read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path, or path relative to the sandbox work directory (/home/user). The canonicalized path must resolve under /home/user or /tmp; anything else is rejected with a 400 invalid_path error. | |
| encoding | No | utf8 | |
| sandboxId | Yes | Public Sandbox id returned by create/list/get sandbox calls. |