audit_file_inventory
Audits every file and folder under a specified Google Drive folder, exporting full metadata including file path, owners, sizes, and timestamps to a Google Sheet.
Instructions
Step 2 — Master file/folder inventory.
Prints every file and folder under the source folder with full
metadata and resolved file paths, then writes the results to the
specified Google Sheet tab.
Fields returned: id, name, mimeType, owners, parents, size,
modifiedTime, createdTime, trashed. `filepath` resolves the full
path from root. `excludetrashed` omits deleted content.
NOTE: If the user has not yet created a Google Sheet, instruct them
to create one named "Migration Audit" with tabs: file_audit,
all_permissions, file_count, own, not_owner, external_owner,
public_files, shortcuts, shared_drive_members, migration_log,
post_migration_permissions.
Args:
user_email: The email of the user who owns the source folder.
folder_id: The ID of the source folder to audit.
sheet_id: The ID of the Google Sheet for output.
sheet_name: The tab name to write to (default: "file_audit").
GAM command:
gam user <user_email> print filelist select <folder_id>
fields "id,name,mimeType,owners,parents,size,modifiedTime,
createdTime,trashed" filepath excludetrashed
todrive tdfileid <sheet_id> tdsheet "<sheet_name>"
tdupdatesheet tdretaintitle
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_email": "<user_email>",
"folder_id": "<folder_id>",
"sheet_id": "<sheet_id>"
},
"name": "audit_file_inventory"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sheet_id | Yes | ||
| folder_id | Yes | ||
| sheet_name | No | file_audit | |
| user_email | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |