Create Drive File
create_drive_fileCreates 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
| 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. | |
| shortcut_target_id | No | 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |