Skip to main content
Glama

upload_local_file

Destructive

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

NameRequiredDescriptionDefault
nameNo
convertNo
local_pathYes
skip_if_existsNo
parent_folder_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.1/5.0
Behavior3/5

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

Adds substantial behavior beyond the lone destructiveHint=true annotation: auth requirements (Service accounts cannot upload to personal Drive), conversion support matrix, skip semantics, and the partial-failure case where convert=True creates a file but metadata retrieval fails. However, the annotation says destructiveHint=true while the description frames skip_if_exists as a safe default, without acknowledging the destructive framing; it also never states overwrite/conflict behavior when skip_if_exists=False. Rich but not fully reconciled with the annotation.

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

Conciseness3/5

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

Front-loaded correctly with the action sentence, but the block runs very long. The extended enumeration of how Drive's Markdown importer renders bullets, fenced code, quotes, and nested numbering (plus a docs link) is far more detail than an agent needs to select or call the tool, and the Returns block substantially duplicates the existing output schema.

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 five-parameter tool with real auth and conversion complexity, nearly everything an agent needs is present, including auth-method caveats and the fileId-on-partial-failure edge case. The main redundancy is restating return fields that the output schema already defines, and the lack of explicit sibling differentiation leaves a small gap.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must carry all parameter meaning, and it does: local_path ('Absolute path'), parent_folder_id (destination folder ID), name (defaults to local filename), skip_if_exists (default True plus stem-match nuance), and convert (per-extension mapping and error on unsupported types). Every one of the five parameters is explained with more detail than the bare schema types.

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?

States a specific verb and resource with scope: 'Upload a file from the local filesystem to a Google Drive folder.' The 'local filesystem' qualifier implicitly separates it from upload_file (in-memory content) and upload_local_folder (whole directory), and the second sentence enumerates supported file types.

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

Usage Guidelines4/5

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

Gives explicit exclusion ('Not available when the server runs with LOCAL_FILE_ACCESS=off') and names a real alternative for a specific case: 'To render a .md the way the Docs tools do, use create_doc_from_file instead.' It does not explicitly contrast with upload_file or upload_local_folder, so the agent must infer those boundaries from sibling names alone.

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