readDriveFile
Read any Google Drive file by ID, auto-detect its type (Doc, Sheet, Word, PDF), route to the correct reader, and return content plus metadata—even when the file type is unknown.
Instructions
Unified read tool: accepts any Google Drive file ID, auto-detects the file type (Google Doc, Sheet, Word .docx, PDF), and routes to the appropriate reader. Returns content along with metadata about available capabilities. Use this when you have a file ID but don't know the file type, or when readDocument fails with a 400 error.
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": {
"fileId": "<fileId>"
},
"name": "readDriveFile"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | No | A1 notation range for Google Sheets (e.g., 'Sheet1!A1:C10'). Required for spreadsheets. | |
| fileId | Yes | The Google Drive file ID (the long string between /d/ and /edit in a Drive URL). | |
| format | No | Output format for Google Docs: 'markdown' (default, preserves rich text/paragraph formatting with a small HTML allowlist), 'text' (plain text), 'json' (raw structure). Ignored for non-Doc files. | markdown |
| plainMarkdown | No | For Google Docs markdown output only. If true, suppresses rich HTML-style formatting extensions and returns cleaner portable markdown. |