Read file
read_fileRead one file from the sandbox: text is returned as text (very long text is shortened in the middle), binary files as base64 (up to 5 MB). Use it to inspect a file or hand its content to the user. For large logs read just the part you need with a shell command (tail, head, grep); result files of background jobs are read from the job, not from a sandbox.
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": {
"path": "<path>"
},
"name": "read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the file | |
| sandbox_id | No | Sandbox ID (sb_…). If omitted, the current sandbox of this session is used. A sandbox_id you pass becomes the current sandbox for later calls without sandbox_id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path of the file. | |
| size | Yes | File size in bytes. | |
| content | Yes | File content (long text is shortened in the middle). | |
| encoding | Yes | text = content as is; base64 = binary file encoded in base64. | |
| shortened | Yes | Text content was shortened in the middle. | |
| sandbox_id | Yes | Sandbox ID. |