Read a file from a deployed site
read_fileReturn one file the site serves now, as text (utf8) or base64 for binary files, e.g. to edit it and send it back with update_site mode:'patch'. Use read_file for the served files; use read_source_file instead for the editable source tree (get_site.sourceStored). Max 5242880 bytes; get_site.filePaths lists the paths.
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 |
|---|---|---|---|
| name | No | Site name as shown by list_sites, e.g. my-portfolio. Provide name or siteId. | |
| path | Yes | Site-relative path of the file to read (e.g. 'index.html', 'assets/main.css'). No leading slash, no '..'. | |
| siteId | No | Site id from list_sites or get_site. Use instead of name. | |
| maxBytes | No | Per-file size cap in bytes. Default 1048576, max 5242880. A larger file fails with FILE_TOO_LARGE instead of returning truncated bytes. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| path | Yes | Echoes the input path, normalized (leading slash stripped, backslashes converted). | |
| size | Yes | Size in bytes of the file on the pod. | |
| siteId | Yes | ||
| content | Yes | ||
| encoding | Yes | utf8: `content` is the text. base64: the file is binary (image, font, ...) and `content` is base64; decode before use. |