Skip to main content
Glama

drive.files.get

Retrieve a Google Drive file's metadata or content by ID; set alt=media to download file contents, or use export for Google Docs, Sheets, and Slides.

Instructions

Gets a file's metadata or content by ID. For more information, see Search for files and folders. If you provide the URL parameter alt=media, then the response includes the file contents in the response body. Downloading content with alt=media only works if the file is stored in Drive. To download Google Docs, Sheets, and Slides use files.export instead. For more information, see [Download and export files](https://developers.google.c [HTTP GET]. Returns the requested resource as JSON — request bodies are built from the typed parameters (typed flags win over the params map), or read whole from body_file Siblings over the same resource: copy, create, delete, download, emptyTrash, export, generateCseToken, generateIds, list, listLabels, modifyLabels, update, watch.

Input Schema

NameRequiredDescriptionDefault
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
fileIdYes[URL path segment] The ID of the file.
paramsNoParameter map merged into the request; typed parameters win.
dry_runNoReturn the request that would be sent, without sending it.
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters.
includeLabelsNo[query parameter] A comma-separated list of IDs of labels to include in the `labelInfo` part of the response.
acknowledgeAbuseNo[query parameter] Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when the `alt` parameter is set to `medifalse
supportsAllDrivesNo[query parameter] Whether the requesting application supports both My Drives and shared drives.false
supportsTeamDrivesNo[query parameter] Deprecated: Use `supportsAllDrives` instead.false
includePermissionsForViewNo[query parameter] Specifies which additional view's permissions to include in the response. Only `published` is supported.

Output Schema

NameRequiredDescriptionDefault
idNo
kindNo
nameNo
sizeNo
ownersNo
sharedNo
spacesNo
driveIdNo
parentsNo
starredNo
trashedNo
versionNo
iconLinkNo
mimeTypeNo
labelInfoNo
ownedByMeNo
propertiesNo
viewedByMeNo
createdTimeNo
descriptionNo
exportLinksNo
md5ChecksumNo
permissionsNo
resourceKeyNo
sharingUserNo
teamDriveIdNo
trashedTimeNo
webViewLinkNo
capabilitiesNo
contentHintsNo
hasThumbnailNo
modifiedByMeNo
modifiedTimeNo
sha1ChecksumNo
trashingUserNo
appPropertiesNo
fileExtensionNo
permissionIdsNo
thumbnailLinkNo
folderColorRgbNo
headRevisionIdNo
quotaBytesUsedNo
sha256ChecksumNo
viewedByMeTimeNo
webContentLinkNo
isAppAuthorizedNo
shortcutDetailsNo
writersCanShareNo
modifiedByMeTimeNo
originalFilenameNo
sharedWithMeTimeNo
thumbnailVersionNo
explicitlyTrashedNo
fullFileExtensionNo
lastModifyingUserNo
linkShareMetadataNo
imageMediaMetadataNo
videoMediaMetadataNo
contentRestrictionsNo
downloadRestrictionsNo
viewersCanCopyContentNo
clientEncryptionDetailsNo
hasAugmentedPermissionsNo
copyRequiresWriterPermissionNo
inheritedPermissionsDisabledNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • addedInput schema / properties / acknowledgeAbuse / default
      Added value: +"false"
    • changedInput schema / properties / acknowledgeAbuse / description
      Previous value: -"Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when the `alt` parameter is set to `medi"New value: +"[query parameter] Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when the `alt` parameter is set to `medi"
    • changedInput schema / properties / fileId / description
      Previous value: -"The ID of the file."New value: +"[URL path segment] The ID of the file."
    • changedInput schema / properties / includeLabels / description
      Previous value: -"A comma-separated list of IDs of labels to include in the `labelInfo` part of the response."New value: +"[query parameter] A comma-separated list of IDs of labels to include in the `labelInfo` part of the response."
    • changedInput schema / properties / includePermissionsForView / description
      Previous value: -"Specifies which additional view's permissions to include in the response. Only `published` is supported."New value: +"[query parameter] Specifies which additional view's permissions to include in the response. Only `published` is supported."
    • addedInput schema / properties / supportsAllDrives / default
      Added value: +"false"
    • changedInput schema / properties / supportsAllDrives / description
      Previous value: -"Whether the requesting application supports both My Drives and shared drives."New value: +"[query parameter] Whether the requesting application supports both My Drives and shared drives."
    • addedInput schema / properties / supportsTeamDrives / default
      Added value: +"false"
    • changedInput schema / properties / supportsTeamDrives / description
      Previous value: -"Deprecated: Use `supportsAllDrives` instead."New value: +"[query parameter] Deprecated: Use `supportsAllDrives` instead."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "appProperties": {
      +      "type": "object"
      +    },
      +    "capabilities": {
      +      "properties": {
      +        "canAcceptOwnership": {
      +          "type": "boolean"
      +        },
      +        "canAccessViaGenAi": {
      +          "type": "boolean"
      +        },
      +        "canAddChildren": {
      +          "type": "boolean"
      +        },
      +        "canAddFolderFromAnotherDrive": {
      +          "type": "boolean"
      +        },
      +        "canAddMyDriveParent": {
      +          "type": "boolean"
      +        },
      +        "canChangeCopyRequiresWriterPermission": {
      +          "type": "boolean"
      +        },
      +        "canChangeItemDownloadRestriction": {
      +          "type": "boolean"
      +        },
      +        "canChangeSecurityUpdateEnabled": {
      +          "type": "boolean"
      +        },
      +        "canChangeViewersCanCopyContent": {
      +          "type": "boolean"
      +        },
      +        "canComment": {
      +          "type": "boolean"
      +        },
      +        "canCopy": {
      +          "type": "boolean"
      +        },
      +        "canDelete": {
      +          "type": "boolean"
      +        },
      +        "canDeleteChildren": {
      +          "type": "boolean"
      +        },
      +        "canDisableInheritedPermissions": {
      +          "type": "boolean"
      +        },
      +        "canDownload": {
      +          "type": "boolean"
      +        },
      +        "canEdit": {
      +          "type": "boolean"
      +        },
      +        "canEnableInheritedPermissions": {
      +          "type": "boolean"
      +        },
      +        "canListChildren": {
      +          "type": "boolean"
      +        },
      +        "canModifyContent": {
      +          "type": "boolean"
      +        },
      +        "canModifyContentRestriction": {
      +          "type": "boolean"
      +        },
      +        "canModifyEditorContentRestriction": {
      +          "type": "boolean"
      +        },
      +        "canModifyLabels": {
      +          "type": "boolean"
      +        },
      +        "canModifyOwnerContentRestriction": {
      +          "type": "boolean"
      +        },
      +        "canMoveChildrenOutOfDrive": {
      +          "type": "boolean"
      +        },
      +        "canMoveChildrenOutOfTeamDrive": {
      +          "type": "boolean"
      +        },
      +        "canMoveChildrenWithinDrive": {
      +          "type": "boolean"
      +        },
      +        "canMoveChildrenWithinTeamDrive": {
      +          "type": "boolean"
      +        },
      +        "canMoveItemIntoTeamDrive": {
      +          "type": "boolean"
      +        },
      +        "canMoveItemOutOfDrive": {
      +          "type": "boolean"
      +        },
      +        "canMoveItemOutOfTeamDrive": {
      +          "type": "boolean"
      +        },
      +        "canMoveItemWithinDrive": {
      +          "type": "boolean"
      +        },
      +        "canMoveItemWithinTeamDrive": {
      +          "type": "boolean"
      +        },
      +        "canMoveTeamDriveItem": {
      +          "type": "boolean"
      +        },
      +        "canReadDrive": {
      +          "type": "boolean"
      +        },
      +        "canReadLabels": {
      +          "type": "boolean"
      +        },
      +        "canReadRevisions": {
      +          "type": "boolean"
      +        },
      +        "canReadTeamDrive": {
      +          "type": "boolean"
      +        },
      +        "canRemoveChildren": {
      +          "type": "boolean"
      +        },
      +        "canRemoveContentRestriction": {
      +          "type": "boolean"
      +        },
      +        "canRemoveMyDriveParent": {
      +          "type": "boolean"
      +        },
      +        "canRename": {
      +          "type": "boolean"
      +        },
      +        "canShare": {
      +          "type": "boolean"
      +        },
      +        "canStartApproval": {
      +          "type": "boolean"
      +        },
      +        "canTrash": {
      +          "type": "boolean"
      +        },
      +        "canTrashChildren": {
      +          "type": "boolean"
      +        },
      +        "canUntrash": {
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "clientEncryptionDetails": {
      +      "properties": {
      +        "decryptionMetadata": {
      +          "properties": {
      +            "aes256GcmChunkSize": {
      +              "type": "string"
      +            },
      +            "encryptionResourceKeyHash": {
      +              "type": "string"
      +            },
      +            "jwt": {
      +              "type": "string"
      +            },
      +            "kaclsId": {
      +              "type": "string"
      +            },
      +            "kaclsName": {
      +              "type": "string"
      +            },
      +            "keyFormat": {
      +              "type": "string"
      +            },
      +            "wrappedKey": {
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "encryptionState": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "contentHints": {
      +      "properties": {
      +        "indexableText": {
      +          "type": "string"
      +        },
      +        "thumbnail": {
      +          "properties": {
      +            "image": {
      +              "type": "string"
      +            },
      +            "mimeType": {
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "contentRestrictions": {
      +      "items": {
      +        "properties": {
      +          "ownerRestricted": {
      +            "type": "boolean"
      +          },
      +          "readOnly": {
      +            "type": "boolean"
      +          },
      +          "reason": {
      +            "type": "string"
      +          },
      +          "restrictingUser": {
      +            "properties": {
      +              "displayName": {
      +                "type": "string"
      +              },
      +              "emailAddress": {
      +                "type": "string"
      +              },
      +              "kind": {
      +                "type": "string"
      +              },
      +              "me": {
      +                "type": "boolean"
      +              },
      +              "permissionId": {
      +                "type": "string"
      +              },
      +              "photoLink": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "restrictionTime": {
      +            "type": "string"
      +          },
      +          "systemRestricted": {
      +            "type": "boolean"
      +          },
      +          "type": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "copyRequiresWriterPermission": {
      +      "type": "boolean"
      +    },
      +    "createdTime": {
      +      "type": "string"
      +    },
      +    "description": {
      +      "type": "string"
      +    },
      +    "downloadRestrictions": {
      +      "properties": {
      +        "effectiveDownloadRestrictionWithContext": {
      +          "properties": {
      +            "restrictedForReaders": {
      +              "type": "boolean"
      +            },
      +            "restrictedForWriters": {
      +              "type": "boolean"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "itemDownloadRestriction": {
      +          "properties": {
      +            "restrictedForReaders": {
      +              "type": "boolean"
      +            },
      +            "restrictedForWriters": {
      +              "type": "boolean"
      +            }
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "driveId": {
      +      "type": "string"
      +    },
      +    "explicitlyTrashed": {
      +      "type": "boolean"
      +    },
      +    "exportLinks": {
      +      "type": "object"
      +    },
      +    "fileExtension": {
      +      "type": "string"
      +    },
      +    "folderColorRgb": {
      +      "type": "string"
      +    },
      +    "fullFileExtension": {
      +      "type": "string"
      +    },
      +    "hasAugmentedPermissions": {
      +      "type": "boolean"
      +    },
      +    "hasThumbnail": {
      +      "type": "boolean"
      +    },
      +    "headRevisionId": {
      +      "type": "string"
      +    },
      +    "iconLink": {
      +      "type": "string"
      +    },
      +    "id": {
      +      "type": "string"
      +    },
      +    "imageMediaMetadata": {
      +      "properties": {
      +        "aperture": {
      +          "type": "number"
      +        },
      +        "cameraMake": {
      +          "type": "string"
      +        },
      +        "cameraModel": {
      +          "type": "string"
      +        },
      +        "colorSpace": {
      +          "type": "string"
      +        },
      +        "exposureBias": {
      +          "type": "number"
      +        },
      +        "exposureMode": {
      +          "type": "string"
      +        },
      +        "exposureTime": {
      +          "type": "number"
      +        },
      +        "flashUsed": {
      +          "type": "boolean"
      +        },
      +        "focalLength": {
      +          "type": "number"
      +        },
      +        "height": {
      +          "type": "integer"
      +        },
      +        "isoSpeed": {
      +          "type": "integer"
      +        },
      +        "lens": {
      +          "type": "string"
      +        },
      +        "location": {
      +          "properties": {
      +            "altitude": {
      +              "type": "number"
      +            },
      +            "latitude": {
      +              "type": "number"
      +            },
      +            "longitude": {
      +              "type": "number"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "maxApertureValue": {
      +          "type": "number"
      +        },
      +        "meteringMode": {
      +          "type": "string"
      +        },
      +        "rotation": {
      +          "type": "integer"
      +        },
      +        "sensor": {
      +          "type": "string"
      +        },
      +        "subjectDistance": {
      +          "type": "integer"
      +        },
      +        "time": {
      +          "type": "string"
      +        },
      +        "whiteBalance": {
      +          "type": "string"
      +        },
      +        "width": {
      +          "type": "integer"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "inheritedPermissionsDisabled": {
      +      "type": "boolean"
      +    },
      +    "isAppAuthorized": {
      +      "type": "boolean"
      +    },
      +    "kind": {
      +      "type": "string"
      +    },
      +    "labelInfo": {
      +      "properties": {
      +        "labels": {
      +          "items": {
      +            "properties": {
      +              "fields": {
      +                "type": "object"
      +              },
      +              "id": {
      +                "type": "string"
      +              },
      +              "kind": {
      +                "type": "string"
      +              },
      +              "revisionId": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "lastModifyingUser": {
      +      "properties": {
      +        "displayName": {
      +          "type": "string"
      +        },
      +        "emailAddress": {
      +          "type": "string"
      +        },
      +        "kind": {
      +          "type": "string"
      +        },
      +        "me": {
      +          "type": "boolean"
      +        },
      +        "permissionId": {
      +          "type": "string"
      +        },
      +        "photoLink": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "linkShareMetadata": {
      +      "properties": {
      +        "securityUpdateEligible": {
      +          "type": "boolean"
      +        },
      +        "securityUpdateEnabled": {
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "md5Checksum": {
      +      "type": "string"
      +    },
      +    "mimeType": {
      +      "type": "string"
      +    },
      +    "modifiedByMe": {
      +      "type": "boolean"
      +    },
      +    "modifiedByMeTime": {
      +      "type": "string"
      +    },
      +    "modifiedTime": {
      +      "type": "string"
      +    },
      +    "name": {
      +      "type": "string"
      +    },
      +    "originalFilename": {
      +      "type": "string"
      +    },
      +    "ownedByMe": {
      +      "type": "boolean"
      +    },
      +    "owners": {
      +      "items": {
      +        "properties": {
      +          "displayName": {
      +            "type": "string"
      +          },
      +          "emailAddress": {
      +            "type": "string"
      +          },
      +          "kind": {
      +            "type": "string"
      +          },
      +          "me": {
      +            "type": "boolean"
      +          },
      +          "permissionId": {
      +            "type": "string"
      +          },
      +          "photoLink": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "parents": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "permissionIds": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "permissions": {
      +      "items": {
      +        "properties": {
      +          "allowFileDiscovery": {
      +            "type": "boolean"
      +          },
      +          "deleted": {
      +            "type": "boolean"
      +          },
      +          "displayName": {
      +            "type": "string"
      +          },
      +          "domain": {
      +            "type": "string"
      +          },
      +          "emailAddress": {
      +            "type": "string"
      +          },
      +          "expirationTime": {
      +            "type": "string"
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "inheritedPermissionsDisabled": {
      +            "type": "boolean"
      +          },
      +          "kind": {
      +            "type": "string"
      +          },
      +          "pendingOwner": {
      +            "type": "boolean"
      +          },
      +          "permissionDetails": {
      +            "items": {
      +              "properties": {
      +                "inherited": {
      +                  "type": "boolean"
      +                },
      +                "inheritedFrom": {
      +                  "type": "string"
      +                },
      +                "permissionType": {
      +                  "type": "string"
      +                },
      +                "role": {
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "photoLink": {
      +            "type": "string"
      +          },
      +          "role": {
      +            "type": "string"
      +          },
      +          "teamDrivePermissionDetails": {
      +            "items": {
      +              "properties": {
      +                "inherited": {
      +                  "type": "boolean"
      +                },
      +                "inheritedFrom": {
      +                  "type": "string"
      +                },
      +                "role": {
      +                  "type": "string"
      +                },
      +                "teamDrivePermissionType": {
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "type": {
      +            "type": "string"
      +          },
      +          "view": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "properties": {
      +      "type": "object"
      +    },
      +    "quotaBytesUsed": {
      +      "type": "string"
      +    },
      +    "resourceKey": {
      +      "type": "string"
      +    },
      +    "sha1Checksum": {
      +      "type": "string"
      +    },
      +    "sha256Checksum": {
      +      "type": "string"
      +    },
      +    "shared": {
      +      "type": "boolean"
      +    },
      +    "sharedWithMeTime": {
      +      "type": "string"
      +    },
      +    "sharingUser": {
      +      "properties": {
      +        "displayName": {
      +          "type": "string"
      +        },
      +        "emailAddress": {
      +          "type": "string"
      +        },
      +        "kind": {
      +          "type": "string"
      +        },
      +        "me": {
      +          "type": "boolean"
      +        },
      +        "permissionId": {
      +          "type": "string"
      +        },
      +        "photoLink": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "shortcutDetails": {
      +      "properties": {
      +        "targetId": {
      +          "type": "string"
      +        },
      +        "targetMimeType": {
      +          "type": "string"
      +        },
      +        "targetResourceKey": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "size": {
      +      "type": "string"
      +    },
      +    "spaces": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "starred": {
      +      "type": "boolean"
      +    },
      +    "teamDriveId": {
      +      "type": "string"
      +    },
      +    "thumbnailLink": {
      +      "type": "string"
      +    },
      +    "thumbnailVersion": {
      +      "type": "string"
      +    },
      +    "trashed": {
      +      "type": "boolean"
      +    },
      +    "trashedTime": {
      +      "type": "string"
      +    },
      +    "trashingUser": {
      +      "properties": {
      +        "displayName": {
      +          "type": "string"
      +        },
      +        "emailAddress": {
      +          "type": "string"
      +        },
      +        "kind": {
      +          "type": "string"
      +        },
      +        "me": {
      +          "type": "boolean"
      +        },
      +        "permissionId": {
      +          "type": "string"
      +        },
      +        "photoLink": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "version": {
      +      "type": "string"
      +    },
      +    "videoMediaMetadata": {
      +      "properties": {
      +        "durationMillis": {
      +          "type": "string"
      +        },
      +        "height": {
      +          "type": "integer"
      +        },
      +        "width": {
      +          "type": "integer"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "viewedByMe": {
      +      "type": "boolean"
      +    },
      +    "viewedByMeTime": {
      +      "type": "string"
      +    },
      +    "viewersCanCopyContent": {
      +      "type": "boolean"
      +    },
      +    "webContentLink": {
      +      "type": "string"
      +    },
      +    "webViewLink": {
      +      "type": "string"
      +    },
      +    "writersCanShare": {
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are present, so the description carries the full behavioral burden. It usefully discloses that alt=media only works for files stored in Drive, but omits permission/scoping requirements and error behavior. The trailing harness boilerplate about request bodies and body_file is irrelevant and mildly confusing for a GET.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening sentence and export guidance are front-loaded and useful, but the text contains a truncated URL ('https://developers.google.c'), generic HTTP/body-building boilerplate, and an appended sibling list. These artifacts add noise rather than signal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the core purpose, the alt=media nuance, and the export alternative, and an output schema exists so return values need not be explained. However, with no annotations and ten parameters (including nested objects), the absence of permission requirements and the misleading body_file boilerplate leave gaps for a GET tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds value by explaining the alt=media query behavior, which is not even represented in the typed schema, giving the agent semantics beyond the parameter list.

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?

States a specific verb and resource ('Gets a file's metadata or content by ID') and immediately distinguishes itself from a key sibling by naming files.export for Google Docs/Sheets/Slides. An agent can identify the tool's function without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear when-to-use condition ('alt=media' for file content) and an explicit alternative (files.export for Google-native formats). It does not address the drive.files.download sibling, which is the most likely competing tool for content retrieval, leaving one routing ambiguity.

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

Deploy Server

Other Tools