Skip to main content
Glama

gdrive_write_file

Creates a new file or overwrites an existing one in Google Drive from supplied text content. Supports markdown, JSON, CSV, and plain text, with optional dry-run to preview before saving.

Instructions

Create or overwrite a text/binary-capable file in Google Drive.

Discovery: run gdrive_search or gdrive_list_folder first to obtain parent folder and optional existing file_id values.

Use this for: writing markdown/text/json/csv files into Drive. Not for: creating a Google Doc — see gdrive_create_doc. Not for: spreadsheet edits — use gsheets-mcp.

Use dry_run=True to preview the change without committing. Overwrites only when file_id is provided or overwrite=True finds a same-named file under the parent. Undo trashes newly created files; content overwrites are not undoable via restore_token.

Args: file_name: Destination file name (e.g., "notes.md") content: File contents to write parent_folder: Optional parent folder name (defaults to My Drive root) parent_folder_id: Optional stable parent folder ID mime_type: Optional MIME type (guessed from file_name when omitted) file_id: Optional existing file ID to overwrite overwrite: If True, overwrite an existing same-named file under the parent dry_run: Preview the write without committing it

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
dry_runNo
file_idNo
file_nameYes
mime_typeNo
overwriteNo
parent_folderNo
parent_folder_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description fully discloses side effects and edge cases: dry_run behavior, overwrite trigger conditions, undo semantics ('Undo trashes newly created files; content overwrites are not undoable via restore_token'), and default MIME guessing. This goes far beyond a basic read/write label.

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 structure is clear and front-loaded with purpose and usage, followed by Args. However, some repetition exists (e.g., dry_run and overwrite are explained both in the narrative and the Args list), so it is slightly less concise than it could be while still being highly efficient.

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?

Given 8 parameters, no annotations, and 0% schema coverage, the description is remarkably complete: it covers discovery, overwrite behavior, dry-run, undo limits, and defaults. Minor gaps remain, such as how binary content is encoded (base64 vs raw string) and precedence when both parent_folder and parent_folder_id are supplied, but these are not critical for typical invocation.

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 carries full parameter meaning. The Args section explains every parameter with practical context: parent_folder by name vs parent_folder_id as stable ID, overwrite triggering on same-named file, and dry_run previewing the commit. It also clarifies optional MIME inference from file_name.

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, resource, and capability: 'Create or overwrite a text/binary-capable file in Google Drive.' It then explicitly excludes sibling tools ('Not for: creating a Google Doc — see gdrive_create_doc') and ('Not for: spreadsheet edits — use gsheets-mcp'), so an agent can disambiguate it 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 gives clear when-to-use guidance: 'Use this for: writing markdown/text/json/csv files into Drive' and explicit not-for alternatives with sibling tool names. It also provides a discovery first-step: 'run gdrive_search or gdrive_list_folder first to obtain parent folder and optional existing file_id values.'

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