Skip to main content
Glama
Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

Create Drive File

create_drive_file

Creates a new Google Drive file from text, base64 bytes, or a URL, supports shared-drive folders, and can generate an upload URL or Drive shortcut.

Instructions

Creates a new file in Google Drive, supporting creation within shared drives. Accepts direct text content, inline base64 bytes, or a fileUrl to fetch content from. Where local file access is disabled it can instead return an upload URL for the caller to PUT file bytes to. With shortcut_target_id it creates a Drive shortcut to an existing file or folder instead. This stores the supplied bytes without converting them to Google Docs, Sheets, or Slides. Use the matching import_to_google_* tool for Google-native conversion.

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": {
      "user_google_email": "<user_google_email>",
      "file_name": "<file_name>"
    },
    "name": "create_drive_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentNoIf provided, the content to write to the file.
fileUrlNoIf provided, fetches the file content from this URL. Supports http:// and https://; file:// only where local file access is enabled. Where it is disabled, files on the caller's machine go through an upload URL instead (see the upload-URL parameter, if offered).
file_nameYesThe name for the new file.
folder_idNoThe ID of the parent folder. Defaults to 'root'. For shared drives, this must be a folder ID within the shared drive.root
mime_typeNoThe MIME type of the file. Defaults to 'text/plain'; required with return_upload_url.
base64_sha256NoExpected SHA-256 of decoded base64_content. Recommended for binary payload integrity checks.
base64_contentNoStandard base64-encoded file bytes.
content_mime_typeNoMIME type for base64_content uploads.
user_google_emailYesThe user's Google email address. Required.
shortcut_target_idNoID of an existing file or folder. Creates a shortcut named file_name in folder_id that points to it, so the item shows up in a second folder without being copied. Not combinable with content sources; mime_type may be omitted.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.2
    • addedInput schema / properties / shortcut_target_id
      Added value: +{
      +  "default": null,
      +  "description": "ID of an existing file or folder. Creates a shortcut named file_name in folder_id that points to it, so the item shows up in a second folder without being copied. Not combinable with content sources; mime_type may be omitted.",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv2.2.0
    • changedInput schema / properties / fileUrl / description
      Previous value: -"If provided, fetches the file content from this URL. Supports file://, http://, and https:// protocols."New value: +"If provided, fetches the file content from this URL. Supports http:// and https://; file:// only where local file access is enabled. Where it is disabled, files on the caller's machine go through an upload URL instead (see the upload-URL parameter, if offered)."
  3. Changed12 schema fields changedv1.28.0
    • removedInput schema / properties / base64_content / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / base64_content / type
      Added value: +"string"
    • removedInput schema / properties / base64_sha256 / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / base64_sha256 / type
      Added value: +"string"
    • removedInput schema / properties / content / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / content / type
      Added value: +"string"
    • removedInput schema / properties / content_mime_type / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / content_mime_type / type
      Added value: +"string"
    • removedInput schema / properties / fileUrl / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / fileUrl / type
      Added value: +"string"
    • changedInput schema / properties / mime_type / default
      Previous value: -"text/plain"New value: +null
    • changedInput schema / properties / mime_type / description
      Previous value: -"The MIME type of the file. Defaults to 'text/plain'."New value: +"The MIME type of the file. Defaults to 'text/plain'; required with return_upload_url."
  4. Changed1 schema field changedv1.25.2
    • addedInput schema / properties / base64_sha256
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Expected SHA-256 of decoded base64_content. Recommended for binary payload integrity checks."
      +}
  5. Addedv1.0.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, and idempotentHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: bytes are stored verbatim without Docs/Sheets/Slides conversion, a SHA-256 integrity check is recommended for binary payloads, and shortcuts reference rather than copy the target. It does not spell out duplicate-name behavior or that repeated calls create separate 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 primary action and the shared-drive scope lead, followed by the mode options and the conversion caveat in descending order of importance. Wording is dense but every sentence carries distinct information; the paragraph form could be tightened but nothing is clearly redundant.

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?

With an output schema present, return values need no explanation, and the annotations carry the mutation profile. For a 10-parameter tool the description covers the important decision points (mode selection, conversion boundary, shared-drive targeting); only edge behaviors like size limits and duplicate handling remain unaddressed.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter is already documented in structured form, and the description largely restates those semantics (shortcut_target_id vs content sources, mime_type with upload URL). It adds marginal value by framing the content sources as an either/or choice among modes, but contributes no syntax or format detail the schema lacks.

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 concrete verb and resource ('Creates a new file in Google Drive') and immediately enumerates the supported creation modes: text content, inline base64, fileUrl fetch, upload URL, and shortcut. It also draws the boundary against the import_to_google_* family, so an agent can distinguish it from sibling creation tools without reading schemas.

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 an explicit alternative for the closest competing need ('Use the matching import_to_google_* tool for Google-native conversion') and explains the conditional routing for upload URLs when local file access is disabled. It stops short of stating when shortcut mode is preferable to copying, leaving that inference to the caller.

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