docs_export
Export Google-native files to Markdown, plain text, HTML, CSV, or PDF, returning paginated text or a saved PDF path for local access.
Instructions
Export a Google Doc (or other Google-native file) to text.
Uses user credentials. Allowed export types: text/markdown, text/plain,
text/html, text/csv, application/pdf. Docs export to all but text/csv.
Sheets export to text/csv (first sheet only) or PDF, and Slides to
text/plain or PDF. A PDF is saved to a local file, and the result gives
its path; open that file to read it. Text comes back 50,000 characters
at a time; a note at the end gives the offset of the next window. The
Drive API refuses exports larger than 10 MB.
For files that are not Google-native (uploaded PDFs, xlsx, txt, ...) use
drive_download instead.
Args: file_id: The Drive file id of a Google-native document. mime_type: Target export MIME type (see allowed list above). offset: Character offset to start the text from. Ignored for PDF.
Returns:
The exported document as text, or for PDF a JSON object
{path, name, mimeType, bytes} describing the saved file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | ||
| file_id | Yes | ||
| mime_type | No | text/markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |