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
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| dry_run | No | ||
| file_id | No | ||
| file_name | Yes | ||
| mime_type | No | ||
| overwrite | No | ||
| parent_folder | No | ||
| parent_folder_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |