Skip to main content
Glama

Drive Upload File

drive_upload_file

Upload a file to Google Drive from a Workspace picker or local path, create a new file, replace an existing file's content, or create an empty Google Doc, Sheet, or Slides file.

Instructions

Upload a file to Drive from the Workspace Files picker or a local path, as a new file or, with file_id, as new content of an existing file (same ID, name, folder and sharing). With neither source it creates an empty file from name and mime_type, such as a blank Google Doc in a chosen folder; for folders use drive_create_folder and to rename or set properties drive_update_file_metadata. Returns status 'ok', mode ('create', 'overwrite', 'skipped', 'replace' or 'metadata_only') and file (id, name, kind, mime_type, size, size_bytes, parent_ids, drive_id, web_url, trashed; null where not reported). Mode 'skipped' returns the same-named file that already exists.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "drive_upload_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoName to store in Drive, including any extension; omit to keep the source file's original name. Required when creating an empty file from metadata.
file_idNoExisting Drive file whose content is replaced by local_path or uploaded_file, keeping its ID, name, folder and sharing; Drive stores it as a new revision. name, parent_ids, if_exists and description are rejected with it. Omit to create a new file.
if_existsNoFor a new upload, what to do when a non-trashed file with the same name exists in the target folder: 'rename' (the default) uploads a new file with a timestamp before the extension, e.g. 'report (upload 20261103-142500).pdf', 'overwrite' replaces that file's content as a new revision, 'skip' uploads nothing and returns the existing file.
mime_typeNoFor an upload, the content's MIME type, e.g. 'application/pdf', 'image/png' or 'text/csv'; the file is stored as-is, not converted, and omitted it is the picker's recorded type or guessed from the extension. For an empty file, its type, e.g. 'application/vnd.google-apps.document' (blank Google Doc), 'application/vnd.google-apps.spreadsheet' (blank Sheet) or 'application/vnd.google-apps.presentation' (blank Slides deck); omit to let Drive choose.
resumableNoUpload content in chunks with progress reports; false sends it in a single request. An empty file has no content to upload.
local_pathNoPath of a file on the machine running the server; accepted only when the server runs locally, and rejected with picker_required over remote MCP. Give at most one of local_path or uploaded_file; omit both to create an empty file from metadata.
parent_idsNoOne parent folder ID (Drive allows a single parent), or a shared drive ID for its top level; omit for the root of My Drive. The if_exists name check looks only in that folder (the root of My Drive when omitted).
descriptionNoDescription text shown in the Drive details of the new or overwritten file.
uploaded_fileNoUpload ID (upl_...) of a file the user added with the Workspace Files picker (uploads_file_manager) or listed by uploads_list_files; the way to send a file over remote MCP. Give at most one of local_path or uploaded_file.
keep_revision_foreverNoWith file_id only: true keeps the new revision forever instead of letting Drive purge it as an old revision; applies to binary (non-Google) files only.

Output Schema

NameRequiredDescriptionDefault
fileNo
modeNo
reasonNo
statusNoMachine-readable operation status.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.2.0

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare write, open-world, non-idempotent, non-destructive; the description adds substantially more — the if_exists collision policies, revision storage for file_id overwrites, that keep_revision_forever applies only to binary files, chunked resumable uploads, and that local_path is rejected with picker_required over remote MCP. These are concrete behavioral and environment constraints an agent could not infer from annotations alone. A minor gap is that it does not describe auth or scope requirements for overwriting files.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action and its three modes are front-loaded in the first sentence, with edge cases and sibling routing following. It is dense and long for a single paragraph, and the trailing return-value listing is partly redundant with the output schema, but every clause carries actionable information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter write tool with zero required parameters and multiple mutually exclusive sources, the description covers source selection, collision handling, overwrite semantics, and environment constraints. The return-value enumeration duplicates the existing output schema, but nothing critical is missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all ten parameters; the description adds value by tying parameters to outcomes, notably the return mode values (create, overwrite, skipped, replace, metadata_only) and which parameters are rejected alongside file_id. It also clarifies that the if_exists name check is scoped to parent_ids or My Drive root, which sharpens the folder-selection parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ("Upload a file to Drive") and immediately enumerates the three operating shapes: new file from picker/local path, content replacement via file_id, and empty-file creation from name and mime_type. It explicitly names the siblings that handle adjacent cases (drive_create_folder, drive_update_file_metadata), so an agent can discriminate without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states when to use this tool versus alternatives: folders go to drive_create_folder, renaming and property changes go to drive_update_file_metadata, and remote MCP uploads must go through uploaded_file from the picker. The choice between sources (local_path vs uploaded_file vs neither) is spelled out with the "at most one" rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools