upload_local_file
Upload a file from the local filesystem to a Google Drive folder, with optional conversion to Google Docs, Sheets, or Slides and duplicate handling.
Instructions
Upload a file from the local filesystem to a Google Drive folder. Handles binary and text files (images, PDFs, DOCX, XLSX, scripts, etc.). Not available when the server runs with LOCAL_FILE_ACCESS=off.
Args: local_path: Absolute path to the local file to upload. parent_folder_id: ID of the destination Drive folder. name: Name to give the file in Drive. Defaults to the local filename. skip_if_exists: If True (default), skip the upload and return the existing file's metadata if a file with the same name already exists in the destination folder. With convert=True, only an existing file already in the target format counts, and one named after the extension-stripped stem (Drive strips the extension on some conversions, e.g. 'report.csv' -> 'report') counts too — see Returns for how an unverified stem match is reported. convert: If True, request Drive's native import conversion instead of uploading as-is: .csv/.xlsx -> Google Sheets, .docx/.md/.html/.htm -> Google Docs, .pptx -> Google Slides. Any other extension returns an error. Default False (upload preserving original format). A .md conversion is recognized by sync_folder's convert_markdown matching too (same underlying mechanism, #211) — a later sync_folder call on the same folder won't create a duplicate. A .md file is rendered by Drive's Markdown importer, not this server's converter, so it looks different from create_doc's output: '-' bullets at every level, fenced code in a gray monospace box with a language label ('None' when it has no recognized language), at the page margin even inside a list item, quotes without a border, nested numbering '1.' rather than 'a.'. Full list: docs/known-limitations.md. To render a .md the way the Docs tools do, use create_doc_from_file instead. Leading YAML front matter is left out of the Doc, as in the Docs tools.
Returns: fileId, name, webViewLink, and 'skipped' (True if skip_if_exists fired) on success, plus web_content_link (a direct download link) for a new non-converted upload. A skip on a stem match whose existing file carries no marker proving this tool converted it from this file (an earlier conversion predating the marker, or an unrelated file sharing the name) also sets 'skipped_unverified': True plus a 'reason'; pass skip_if_exists=False to upload anyway. On failure, 'error' — plus a 'fileId' alongside it in the narrow case where convert=True and the file was actually created in Drive but a follow-up metadata call then failed (#420): that fileId names a real, already-created Drive file, not something to retry creating again.
Note: Requires OAuth or ADC auth. Service accounts cannot upload files to personal Drive (no storage quota). Works on Shared Drives regardless of auth method. Check server://auth-status for your current auth method.
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": {
"local_path": "<local_path>",
"parent_folder_id": "<parent_folder_id>"
},
"name": "upload_local_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| convert | No | ||
| local_path | Yes | ||
| skip_if_exists | No | ||
| parent_folder_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||