upload_file
Upload text content as a Google Drive file, optionally converting Markdown or HTML into a formatted Google Doc in a chosen folder.
Instructions
Upload a text file to Google Drive, optionally converting it to a Google Doc.
Args: name: File name (include extension, e.g. 'notes.md', 'report.html'). content: Text content to upload. source_format: How to interpret the content. One of: 'markdown' — Markdown text. Uploaded as an HTML file, or with convert_to_doc=True written into a new Doc (see convert_to_doc). 'html' — Raw HTML. 'text' — Plain text (default). folder_id: Destination folder ID. Defaults to the configured folder or Drive root. convert_to_doc: If True, create a Google Doc instead of a raw file. A 'markdown' source is written with the same converter as create_doc(content_format='markdown'), so it renders the same way, images included (a local path, drive:<file_id> or public http(s) URL, embedded as create_doc does; bare URLs are linked). An 'html' source keeps its heading, list, and link formatting via Drive's HTML import. 'text' uploads as plain text and Drive converts it (no formatting preserved). auto_downscale: For a 'markdown' source with convert_to_doc=True, resize a local-path/drive: image over Google Docs' inline-image limit instead of failing it (default False), as create_doc's auto_downscale does: a drive: source gets a new " (resized)" copy beside the original, a local-path source uploads the resized bytes. No effect otherwise.
Returns: fileId, name, parent folder ID, and webViewLink of the created file. A Markdown Doc also gets create_doc's "images" (per-image outcomes) and "dropped_links" (links written as plain text) when there are any. If writing a Markdown Doc's content fails after the Doc was created, returns {"error", "fileId"} plus those fields instead.
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": {
"name": "<name>",
"content": "<content>"
},
"name": "upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| content | Yes | ||
| folder_id | No | ||
| source_format | No | text | |
| auto_downscale | No | ||
| convert_to_doc | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||