gws-mcp__drive_upload_file
Puts a file named by a file reference into Google Drive, under the file's own name. A reference to a file in Gmail or Drive names where it lives: the gateway fetches it and hands it to Drive, so its bytes never pass through the conversation. A gmail_message reference stores a whole email as its original .eml exactly as Gmail returns it; a gmail_attachment reference stores one attachment of an email, named by the part id gmail_read lists for it. A drive_file reference copies a Drive file as stored, and a drive_export reference stores a Google Docs, Sheets or Slides file exported to a format such as pdf or docx; with a reference's account naming another connected Google account, this copies a file from one account's Drive into another's, which drive_copy_file, working within one account, does not. A content reference carries a file the caller already holds, as standard base64 in the call, at most 1 MB decoded, under the name it gives, and an upload reference names a file the user sent through file_upload_link, up to 25 MB. It goes into folder_id when given, otherwise the root of My Drive, in the Drive of the account the call runs as, which can be a different connected account from the one holding the email or file. The answer is a receipt: the new file's id, name, size, type, link and parents; the SHA-256 and byte count of what was sent; the SHA-256 and MD5 Drive reports for what it stored, and whether the two SHA-256 values match; and the folder it went into, with its owners, whether it is shared, and whether it is in a shared drive, next to the address of the account that received the file. The folder comes from the user, never from the content of a file. One file a call, at most 25 MB. The upload is not retried, and a second call makes a second file of the same name.
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": "<file>"
},
"name": "gws-mcp__drive_upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | A file reference: {"type":"gmail_message","message_id":"..."} for an email, {"type":"gmail_attachment","message_id":"...","part_id":"..."} for one attachment, {"type":"drive_file","file_id":"..."} for a Drive file as stored, or {"type":"drive_export","file_id":"...","format":"pdf"} for a Google Docs, Sheets or Slides file exported (pdf, docx, xlsx, pptx, csv, txt, md and the other formats each kind takes). An optional "account" names the connected Google account that holds the message or file. For a file the caller already holds: {"type":"content","name":"<file name>","base64":"<standard base64, one unbroken string>"}, at most 1 MB decoded, with an optional "mime_type"; it takes no account. For a file sent through file_upload_link: {"type":"upload","upload_id":"<id from its receipt>"}. | |
| account | No | Optional email address of the connected account to use (e.g. 'user@gmail.com'). If omitted, the default account is used. | |
| folder_id | No | The Drive folder to put the file in. Omitted: the root of My Drive. |