Create Drive File
create_drive_fileCreates a new Google Drive file from text, base64 bytes, or a URL, supports shared-drive folders, and returns an upload URL when local file access is disabled.
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. 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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | If provided, the content to write to the file. | |
| fileUrl | No | 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). | |
| file_name | Yes | The name for the new file. | |
| folder_id | No | The ID of the parent folder. Defaults to 'root'. For shared drives, this must be a folder ID within the shared drive. | root |
| mime_type | No | The MIME type of the file. Defaults to 'text/plain'; required with return_upload_url. | |
| base64_sha256 | No | Expected SHA-256 of decoded base64_content. Recommended for binary payload integrity checks. | |
| base64_content | No | Standard base64-encoded file bytes. | |
| content_mime_type | No | MIME type for base64_content uploads. | |
| user_google_email | Yes | The user's Google email address. Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |