Fetch Attachment Content (Drive)
drive_fetch_file_contentRead text content from Google Drive attachments in Classroom coursework, materials, or announcements. Converts Docs, Sheets, and Slides to text or CSV; binary files return metadata and link.
Instructions
Read the text content of a Google Drive file attached to Classroom coursework, materials, or announcements.
Handles each type appropriately:
Google Docs → exported as plain text
Google Sheets → exported as CSV
Google Slides → exported as plain text
text/csv/markdown/html/json/xml/rtf → downloaded directly
PDFs, images, and other binary files → returns metadata + link (content can't be rendered as text)
Args:
drive_file_id (string): The Drive file id from an attachment's driveFile.driveFile.id
response_format ('markdown' | 'json')
Returns: name, mime_type, size, link, and (when readable) content. Long content is truncated to a character limit with a note.
Error Handling:
403/permission → the Drive scope may be missing; re-run
npm run auth404 → the file id is wrong or you lack access to that file
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| drive_file_id | Yes | The Drive file id of an attachment. Find it in the materials arrays returned by classroom_list_coursework / list_materials / dump_course (driveFile.driveFile.id). | |
| response_format | No | Output format: 'markdown' for human-readable or 'json' for raw data | markdown |