Skip to main content
Glama
taylorwilsdon

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

Update Drive File

update_drive_file
Destructive

Update a Google Drive file's content, metadata, and properties in place, preserving its ID, sharing, and links. Append or prepend text without rewriting the whole file.

Instructions

Updates metadata, properties, and/or content of a Google Drive file.

Providing new content (inline as content, fetched from file_url, or on a local server read from a file path) replaces the file's content in place, preserving the existing file ID, sharing, comments, and links. For native Google Docs/Sheets/Slides the source is uploaded with its source MIME type so the Drive API applies the same format conversion as import_to_google_doc (markdown headings, tables, bold, etc.). For any other file (.md, .txt, .pdf, ...) there is nothing to convert, so the bytes are written back as-is under the file's own MIME type. Metadata and content can be updated in a single call.

mode='append'/'prepend' splice content onto the file's existing text server-side, so only the new text has to be supplied — no need to send the whole file back to rewrite it.

Drive shortcuts are handled according to the kind of update: supported resource-local metadata changes (rename, move, trash, star, description, and custom properties) apply to the supplied shortcut, while content replacement follows the shortcut and updates its target. To avoid applying metadata to the wrong resource, a shortcut call cannot combine content with resource-local metadata. Update the shortcut metadata and target content in separate calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoHow to apply the new content — 'replace' (default), 'append', or 'prepend'. Append/prepend require 'content' and a UTF-8 text file such as .md or .txt; a newline is inserted at the seam if neither side has one. For native Google Docs use insert_doc_elements, modify_doc_text, or find_and_replace_doc, which edit in place instead of rewriting the file.replace
nameNoNew name for the file.
contentNoNew text content for text-based formats (markdown, TXT, HTML).
file_idYesThe ID of the file to update. Required.
starredNoWhether to star/unstar the file.
trashedNoWhether to move file to/from trash.
file_urlNoRemote http(s) URL to fetch new content from.
file_pathNoLocal file path for binary formats (DOCX, ODT). Supports file:// URLs.
mime_typeNoNew MIME type (note: changing type may require content upload). For a shortcut ID, this must accompany content and applies to the resolved target.
propertiesNoCustom key-value properties for the file.
add_parentsNoComma-separated folder IDs to add as parents.
descriptionNoNew description for the file.
source_formatNoSource format hint for conversion (md, markdown, docx, txt, html, rtf, odt). Auto-detected when omitted, and ignored for non-Google files, which are uploaded without conversion. Provide at most one content source.
remove_parentsNoComma-separated folder IDs to remove from parents.
user_google_emailYesThe user's Google email address. Required.
writers_can_shareNoWhether editors can share the file. Pass the target ID directly; this cannot be changed on a shortcut resource.
copy_requires_writer_permissionNoWhether copying requires writer permission. Pass the target ID directly; this cannot be changed on a shortcut resource.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed30 schema fields changedv1.28.0
    • removedInput schema / properties / add_parents / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / add_parents / 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 / copy_requires_writer_permission / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / copy_requires_writer_permission / type
      Added value: +"boolean"
    • removedInput schema / properties / description / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / description / type
      Added value: +"string"
    • removedInput schema / properties / file_path / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / file_path / type
      Added value: +"string"
    • removedInput schema / properties / file_url / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / file_url / type
      Added value: +"string"
    • removedInput schema / properties / mime_type / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / mime_type / type
      Added value: +"string"
    • removedInput schema / properties / name / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / name / type
      Added value: +"string"
    • addedInput schema / properties / properties / additionalProperties
      Added value: +true
    • removedInput schema / properties / properties / anyOf
      Removed value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / properties / type
      Added value: +"object"
    • removedInput schema / properties / remove_parents / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / remove_parents / type
      Added value: +"string"
    • removedInput schema / properties / source_format / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • changedInput schema / properties / source_format / description
      Previous value: -"Source format hint for conversion\n(md, markdown, docx, txt, html, rtf, odt). Auto-detected when omitted, and\nignored for non-Google files, which are uploaded without conversion.\nProvide at most one of content/file_path/file_url."New value: +"Source format hint for conversion\n(md, markdown, docx, txt, html, rtf, odt). Auto-detected when omitted, and\nignored for non-Google files, which are uploaded without conversion.\nProvide at most one content source."
    • addedInput schema / properties / source_format / type
      Added value: +"string"
    • removedInput schema / properties / starred / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / starred / type
      Added value: +"boolean"
    • removedInput schema / properties / trashed / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / trashed / type
      Added value: +"boolean"
    • removedInput schema / properties / writers_can_share / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / writers_can_share / type
      Added value: +"boolean"
  2. Changed3 schema fields changedv1.25.2
    • changedInput schema / properties / copy_requires_writer_permission / description
      Previous value: -"Whether copying requires writer permission."New value: +"Whether copying requires writer\npermission. Pass the target ID directly; this cannot be changed on a\nshortcut resource."
    • changedInput schema / properties / mime_type / description
      Previous value: -"New MIME type (note: changing type may require content upload)."New value: +"New MIME type (note: changing type may require\ncontent upload). For a shortcut ID, this must accompany content and applies\nto the resolved target."
    • changedInput schema / properties / writers_can_share / description
      Previous value: -"Whether editors can share the file."New value: +"Whether editors can share the file. Pass the\ntarget ID directly; this cannot be changed on a shortcut resource."
  3. Changed2 schema fields changedv1.24.0
    • addedInput schema / properties / mode
      Added value: +{
      +  "default": "replace",
      +  "description": "How to apply the new content — 'replace' (default), 'append', or\n'prepend'. Append/prepend require 'content' and a UTF-8 text file such as\n.md or .txt; a newline is inserted at the seam if neither side has one.\nFor native Google Docs use insert_doc_elements, modify_doc_text, or\nfind_and_replace_doc, which edit in place instead of rewriting the file.",
      +  "type": "string"
      +}
    • changedInput schema / properties / source_format / description
      Previous value: -"Source format hint for conversion\n(md, markdown, docx, txt, html, rtf, odt). Auto-detected when omitted.\nProvide at most one of content/file_path/file_url."New value: +"Source format hint for conversion\n(md, markdown, docx, txt, html, rtf, odt). Auto-detected when omitted, and\nignored for non-Google files, which are uploaded without conversion.\nProvide at most one of content/file_path/file_url."
  4. Addedv1.0.1

TDQS

A4.6/5.0
Behavior5/5

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

Even with annotations already signaling destructive=true, the description adds substantial behavior beyond those flags: content replacement preserves file ID, sharing, comments, and links; native Google files are converted via the same mechanism as import_to_google_doc; append/prepend operate server-side; and shortcut semantics are explained in detail, including the prohibition on mixing content replacement with resource-local metadata.

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 description is long but earns its length: it front-loads the core purpose and then addresses complex behaviors (conversion, append/prepend, shortcuts) in focused paragraphs. It is dense rather than padded, though slightly more structure or explicit headings could help scannability for a 17-parameter tool.

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 high-complexity tool with 17 parameters, the description covers all major behavioral dimensions an agent needs: content replacement semantics, MIME conversion behavior, append/prepend mechanics, shortcut handling, and the one-call metadata-plus-content capability. The output schema and detailed input schema already cover return values and individual parameters, so nothing critical is missing.

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 baseline is 3, but the description adds cross-parameter meaning that the schema alone does not: it groups content sources (content, file_url, file_path) into one coherent behavior, explains what append/prepend do to the file, and clarifies which parameters apply to shortcut targets versus the shortcut resource itself. This goes beyond individual property descriptions.

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 precise verb+resource statement: 'Updates metadata, properties, and/or content of a Google Drive file.' It then distinguishes several distinct behaviors (in-place replacement preserving ID, native-format conversion, append/prepend, shortcut handling), so an agent can clearly separate this from siblings like create_drive_file, copy_drive_file, and import_to_google_doc.

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?

The description gives clear context for when this tool is appropriate, such as replacing content in place while preserving IDs, and when to use one-call metadata-plus-content updates. It also routes native Google Docs edits to sibling tools like insert_doc_elements, modify_doc_text, and find_and_replace_doc via the mode parameter, though that routing lives in the schema rather than the main description.

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