Get file metadata
get_fileFetch a file's metadata—name, type, size, timestamps, permissions, and links—without downloading content. Choose specific fields for a custom projection when you need more or fewer details.
Instructions
Returns a file's metadata (never its content — that is download_file/export_file): id, name, mimeType, size, parents, driveId, createdTime/modifiedTime, trashed, starred, description, md5Checksum, webViewLink, webContentLink, exportLinks (for Google-native files), owners, lastModifyingUser, shortcutDetails (a shortcut's real target id/mimeType) and capabilities (canEdit/canShare/canTrash/canDelete/canDownload — check before mutating). Google-native files (mimeType application/vnd.google-apps.*) report no size and no md5Checksum. Pass fields to select a custom projection (Drive fields syntax) when the default set is too much or too little.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | Custom Drive fields projection, e.g. "id,name,permissions(id,role,emailAddress)". Defaults to a rich metadata set. | |
| file_id | Yes | The file id — the long id from the Drive URL (drive.google.com/file/d/<fileId> or docs.google.com/.../d/<fileId>/edit) or from search_files/get_file output. Folders and shared-drive items are files too. |