Skip to main content
Glama

download_file

Read-only

Download a Google Drive file to a local path; Google Workspace files require an export_format to convert Docs, Sheets, or Slides before saving.

Instructions

Download a file from Google Drive to the local filesystem. Not available when the server runs with LOCAL_FILE_ACCESS=off.

For non-Google files the raw content is downloaded. For Google Workspace files (Docs, Sheets, Slides) an export_format is required to convert the file before download.

If local_path is a directory, the file is saved inside it using the Drive filename (with an extension appended for exported Workspace files). A local_path ending in a path separator (or in '/.' or '/..') is always treated as a directory target, and is created (mkdir -p) if it doesn't exist yet. Directories are created only once the content is ready to write, so a refused call or a failed export leaves nothing new on disk; a non-Workspace download that fails partway keeps the directory it created. A local_path that can't be written (a parent is a file, or the destination is a symlink to a missing target) raises ValueError before anything is downloaded. A Drive name that isn't a single ordinary filename (it contains '/' or '', is '.' or '..', etc.) is refused for a directory target with a ValueError, before anything is written; pass a full file path as local_path instead.

Args: file_id: The Google Drive file ID. local_path: Destination file path or directory on the local filesystem. export_format: Required for Google Workspace files. One of: Docs → 'pdf', 'docx', 'html', 'txt', 'odt', 'rtf', 'epub' Sheets → 'pdf', 'xlsx', 'csv', 'ods' Slides → 'pdf', 'pptx' For non-Google files omit this (raw download).

Returns: local_path where the file was written, file name, and byte size.

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_id": "<file_id>",
      "local_path": "<local_path>"
    },
    "name": "download_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_idYes
local_pathYes
export_formatNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.3/5.0
Behavior4/5

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

The description goes well beyond the annotations, disclosing mkdir -p behavior, the exact timing of directory creation, partial-failure residue ('a non-Workspace download that fails partway keeps the directory it created'), pre-download ValueError cases, and refused Drive filenames. One gap: readOnlyHint=true is not reconciled with the fact that this tool writes to the local filesystem, and no auth/permission requirements are mentioned.

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?

Purpose and availability are front-loaded before the dense local_path paragraph, and nearly every sentence carries actionable edge-case information. The directory-target paragraph is long and repeats 'before anything is downloaded/written' twice, which slightly dilutes readability.

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

Completeness5/5

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

For a 3-parameter tool with zero schema descriptions, the definition covers purpose, availability constraint, format requirements, destination semantics, and failure behavior. An output schema exists, so the brief Returns block is redundant but harmless, and nothing an agent needs to call it correctly is missing.

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 coverage is 0%, so the description carries the full burden and does: file_id is identified as the Drive file ID, local_path's directory-target semantics (trailing separator, '/.', '/..', filename validation) are spelled out, and export_format's complete valid value set per Workspace type is supplied even though the schema only declares a bare string.

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

Purpose4/5

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

The opening sentence gives a specific verb and resource ('Download a file from Google Drive to the local filesystem') and the conversion note clarifies that Workspace files are exported on the way. It never names a sibling such as export_file or download_folder, so the agent gets a clear purpose but no explicit differentiation from adjacent tools.

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?

It states concrete conditions: export_format is required for Docs/Sheets/Slides and must be omitted for non-Google files, and the tool is unavailable when LOCAL_FILE_ACCESS=off. It stops short of routing guidance (e.g., when to prefer export_file or download_folder instead), so the when-not-to-use case relative to siblings is left implicit.

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