Export a doc to a file
export_docExport a Google Doc to a real file on disk as PDF, DOCX, TXT, HTML, EPUB, MD, or other formats with editor-matching layout; target one tab if needed.
Instructions
Export a Google Doc to a real file on disk — pdf (default), docx, odt, rtf, txt, html, epub, or md. Google renders it server-side (File > Download in the UI), so page setup, pagination and layout match the editor. A doc path exports every tab; a tab path (/folder/doc/tab) exports only that tab, through an endpoint Google does not document and rate-limits — if it fails the call is refused and says so, it never falls back to the whole doc. Returns the local path and byte size. Note: Drive refuses to export files larger than 10 MB.
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>",
"dir": "<dir>"
},
"name": "export_doc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | Yes | absolute local folder to save the export into (created if missing) | |
| path | Yes | The doc: a Drive id or URL, or /folder/doc. A tab path names its doc. | |
| format | No | default pdf | |
| account | No | Google account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account. | |
| filename | No | override the filename (default: the doc’s title + extension) |