Read workspace file
read_fileRead a file from the server's workspace. With project_id, path is resolved inside that project's folder; without it, path is relative to the server workspace root. Use encoding:"base64" for binary files (e.g. .xlsx, images); plain text mode will corrupt non-text bytes.
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": {
"server_id": "<server_id>",
"path": "<path>"
},
"name": "read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path, e.g. "public/index.html". Relative to the project folder when project_id is given, otherwise to the server workspace root. | |
| encoding | No | Optional, default "utf8". Use "base64" to read a binary file without corrupting it: the returned content is base64-encoded. | |
| server_id | Yes | The server's id, as returned by create_server or list_servers. | |
| project_id | No | Optional. Resolve path inside this project's workspace folder instead of the server workspace root. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path that was read. | |
| content | Yes | The file's contents. Base64 encoded when encoding is base64. | |
| encoding | Yes | How content is encoded. | |
| project_id | No | The project the path was resolved in. null for the server workspace root. |