Domain: drive

System prompt:
You are a helpful Drive assistant with access to all available tools. Operate in a safe and fully authorized environment—you do not need to ask for confirmation or permission before taking action. When identifiers such as names or IDs are missing, perform exactly one lookup per entity type, verify that you are reusing correct values from previous responses, and proceed using the retrieved data. Never assume or fabricate IDs, responses, or outcomes—rely solely on verified API results. Complete each task in a single, logical, and efficient execution flow. For any tool that supports the 'supportsAllDrives' key, you must include it in the tool request body and set its value to true. A user must have the right privilege to carry out a change on any resource.

Task:
Emily Davis needs to archive the 'Employee Handbook.docx' for compliance before starting updates. Create an archive copy with filename 'Employee Handbook_archive.docx' and include archival file metadata with archive_status(archived) and archive_date(2024-12-01). The archive requires reader access for the external auditor (auditor@external.com) only. Document the legal review status on the original with a comment stating "The legal review has been scheduled and will be completed before final publication." Sarah Johnson's access on the original document needs to transition from commenting to full editing privileges for content updates. Document the archival completion on the archive copy with "Archive created for compliance retention. Restricted to auditor access only." and on the original with "Working copy ready for Q1 updates. Archive version secured for regulatory review."

Available tools:
copy_files
list_permission
update_files
create_comments
create_permission
update_permission
list_files

Verification checks:
[{"verifier_type": "database_state", "name": "Archive Copy Created with Archival Metadata", "description": "Archive Copy Created with Archival Metadata", "gym_name": "gym-google-drive-mcp", "validation_config": {"query": "WITH archive_copy AS (\n  SELECT\n    id,\n    name,\n    app_properties,\n    created_time\n  FROM files\n  WHERE name = 'Employee Handbook_archive.docx'\n    AND mime_type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n    AND trashed = 0\n)\nSELECT COUNT(*) AS cnt\nFROM archive_copy\nWHERE json_extract(app_properties, '$.archive_status') = 'archived'\n  AND json_extract(app_properties, '$.archive_date') = '2024-12-01'\n  AND created_time > '2024-12-01 00:00:00';", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "External Auditor Has Reader Access to Archive", "description": "External Auditor Has Reader Access to Archive", "gym_name": "gym-google-drive-mcp", "validation_config": {"query": "WITH archive_file AS (\n  SELECT id\n  FROM files\n  WHERE name = 'Employee Handbook_archive.docx'\n    AND trashed = 0\n),\nauditor_user AS (\n  SELECT id\n  FROM users\n  WHERE email = 'auditor@external.com'\n)\nSELECT COUNT(*) AS cnt\nFROM permissions p\nINNER JOIN archive_file af ON af.id = p.file_id\nINNER JOIN auditor_user au ON au.id = p.user_id\nWHERE p.role = 'reader'\n  AND p.type = 'user'\n  AND p.deleted = 0;", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Legal Review Comment Created", "description": "Legal Review Comment Created", "gym_name": "gym-google-drive-mcp", "validation_config": {"query": "SELECT COUNT(*) AS cnt\nFROM comments\nWHERE file_id = '01JBQM3K8TGHZX9RNVQM5Y2P8T'\n  AND deleted = 0\n  AND LOWER(content) LIKE '%legal review%scheduled%'\n  AND LOWER(content) LIKE '%before final publication%';", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Sarah Johnson Permission Upgraded to Writer", "description": "Sarah Johnson Permission Upgraded to Writer", "gym_name": "gym-google-drive-mcp", "validation_config": {"query": "WITH sarah_user AS (\n  SELECT id\n  FROM users\n  WHERE email = 'sarah.johnson@company.com'\n)\nSELECT COUNT(*) AS cnt\nFROM permissions p\nINNER JOIN sarah_user su ON su.id = p.user_id\nWHERE p.file_id = '01JBQM3K8TGHZX9RNVQM5Y2P8T'\n  AND p.role = 'writer'\n  AND p.type = 'user'\n  AND p.deleted = 0;", "expected_value": 1, "comparison_type": "equals"}}, {"verifier_type": "database_state", "name": "Documentation Comments Created on Both Files", "description": "Documentation Comments Created on Both Files", "gym_name": "gym-google-drive-mcp", "validation_config": {"query": "WITH archive_file AS (\n  SELECT id\n  FROM files\n  WHERE name = 'Employee Handbook_archive.docx'\n    AND trashed = 0\n),\narchive_comment AS (\n  SELECT COUNT(*) AS cnt\n  FROM comments c\n  INNER JOIN archive_file af ON af.id = c.file_id\n  WHERE c.deleted = 0\n    AND LOWER(c.content) LIKE '%archive created for compliance retention%'\n    AND LOWER(c.content) LIKE '%restricted to auditor access only%'\n),\noriginal_comment AS (\n  SELECT COUNT(*) AS cnt\n  FROM comments\n  WHERE file_id = '01JBQM3K8TGHZX9RNVQM5Y2P8T'\n    AND deleted = 0\n    AND LOWER(content) LIKE '%working copy ready for q1 updates%'\n    AND LOWER(content) LIKE '%archive version secured for regulatory review%'\n)\nSELECT\n  CASE\n    WHEN (SELECT cnt FROM archive_comment) >= 1\n     AND (SELECT cnt FROM original_comment) >= 1\n    THEN 1\n    ELSE 0\n  END AS cnt;", "expected_value": 1, "comparison_type": "equals"}}]