Gdrive Read File
gdrive_read_fileReads a text file from the synced Google Drive folder (.txt, .md, .csv, .json, code files...). Note: native Google Docs/Sheets/Slides sync as .gdoc/.gsheet pointers, not real files — export them from Drive or read Office/PDF copies instead. Auto-detects UTF-8 with Latin-1/CP1252 fallback. For files outside Google Drive, use file_read.
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": "gdrive_read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the file | |
| offset | No | Start byte offset (default 0) | |
| encoding | No | 'auto' (default), 'utf8', 'latin1', 'cp1252', 'ascii', 'utf16' | |
| max_bytes | No | Max bytes (default 1MB, cap 10MB) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path of the file | |
| bytes | Yes | Total file size in bytes | |
| offset | No | Byte offset the read started at | |
| content | Yes | Decoded file text content | |
| encoding | No | Encoding used to decode (utf8 | cp1252 | latin1 | ascii | utf16) | |
| truncated | No | True if more content remains beyond what was returned | |
| bytes_read | No | Number of bytes read in this slice |