download_file
Download a Google Drive file to a local path; Google Workspace files require an export_format to convert Docs, Sheets, or Slides before saving.
Instructions
Download a file from Google Drive to the local filesystem. Not available when the server runs with LOCAL_FILE_ACCESS=off.
For non-Google files the raw content is downloaded. For Google Workspace files (Docs, Sheets, Slides) an export_format is required to convert the file before download.
If local_path is a directory, the file is saved inside it using the Drive filename (with an extension appended for exported Workspace files). A local_path ending in a path separator (or in '/.' or '/..') is always treated as a directory target, and is created (mkdir -p) if it doesn't exist yet. Directories are created only once the content is ready to write, so a refused call or a failed export leaves nothing new on disk; a non-Workspace download that fails partway keeps the directory it created. A local_path that can't be written (a parent is a file, or the destination is a symlink to a missing target) raises ValueError before anything is downloaded. A Drive name that isn't a single ordinary filename (it contains '/' or '', is '.' or '..', etc.) is refused for a directory target with a ValueError, before anything is written; pass a full file path as local_path instead.
Args: file_id: The Google Drive file ID. local_path: Destination file path or directory on the local filesystem. export_format: Required for Google Workspace files. One of: Docs → 'pdf', 'docx', 'html', 'txt', 'odt', 'rtf', 'epub' Sheets → 'pdf', 'xlsx', 'csv', 'ods' Slides → 'pdf', 'pptx' For non-Google files omit this (raw download).
Returns: local_path where the file was written, file name, and byte size.
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": {
"file_id": "<file_id>",
"local_path": "<local_path>"
},
"name": "download_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes | ||
| local_path | Yes | ||
| export_format | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||