Skip to content

How to browse Photos and Drive and review cleanup

View as Markdown
  1. Find the intended route-backed Photos or Drive filesystem with endpoint_query. Personal and shared Photos libraries are separate endpoints. Read the exact endpointId; use only declared filesystem-provider commands through control with waitForResult:true. Search filesystem-provider capability and Photos/Drive names across relevant host-listed authorized connections before claiming no library exists. Generic ENDPOINT_PLUGIN catalogs and old unrouted FILESYSTEM records are not concrete provider routes; ignore them for file operations without deleting or merging them. If only unrouted matches exist in one account, check other relevant authorized accounts. Preserve the returning account with every ID and cursor. Clarify multiple matching libraries before a write.
  2. For Drive, list-folder with no folderId lists root; descend using returned folder IDs. For Photos, list-albums discovers albums such as Screenshots; list-folder accepts a returned album ID. Follow returned nextCursor using cursor on the same folder/album. Do not assume a small first page represents all files. Photos pages contain at most 100 assets and resume directly at the provider rank; always follow nextCursor, even when fewer than maxResults were returned. Keep cursor, library and album together. Paging observes a live library: edits during enumeration can shift ranks, so collect candidates before making changes, and refresh their identities before deletion. Old cursors must restart after a pagination version change.
  3. Copy the returned itemId into download-file's fileId. Download returns a URI that must be fetched to inspect actual contents. Photos returns an original HTTPS resource URL. Current iCloud Drive downloads are inline and limited to 10 MiB per file; a complete large-file backup is not supported by this adapter. Do not expose signed download URLs in summaries or logs.
  4. For screenshot cleanup, prefer the discovered Screenshots album over filename guesses. To classify other images, inspect downloaded contents; name/extension alone does not establish that a photo is disposable. Present candidates/reasons and follow the user's authorized selection/scope.
  5. Use delete-file only for items the user authorized deleting. The iCloud adapter trashes Drive nodes and soft-deletes Photos. A cleanup recommendation is not an instruction to delete. Send each deletion once, wait for its correlated response and verify absence by re-listing the same selection; for Photos also account for album membership and library identity. Timeouts leave an unknown outcome, so inspect before considering another action.

For upload, select a concrete Drive route that declares upload-file, use its documented payload fields, including the attached file's actual bytes encoded as base64, destination folderId, name and MIME type. Ask for a missing file or ambiguous destination. The iCloud Drive adapter supports up to 10 MiB decoded, requires the filename extension to match the MIME type, and rejects an existing name instead of overwriting it. Upload once with waitForResult:true; use the returned fileId for readback and re-list the destination. If the result is missing or unconfirmed, inspect the destination before considering another upload. Drive routes may declare rename-file and move-file for files. Copy the current fileId, supply the full new name for rename-file or a discovered destination folderId for move-file, send once with waitForResult:true, and use the returned fileId afterward. Rename and move reject destination name collisions and verify the exact file identity/name in the destination; an unconfirmed result requires re-listing source and destination before another write. Folder rename/move, Photos upload/rename/move, and content replacement remain unsupported by this adapter. A capability's upload-file-response output alone does not establish an upload command; discovery is authoritative.

Collect Photos by unique itemId across pages. The adapter excludes Apple's repeated boundary asset while preserving provider-rank advancement; a filtered page can be empty and still have nextCursor. Concurrent library changes can introduce other overlaps, so report the unique count and do not process the same asset twice.

Reminders uses its own provider capability; only use create/update/delete when declared, since older iCloud accounts may expose list-reminders only.

For multiple attached files, preserve each attachment's actual bytes, filename and MIME type; do not reconstruct a binary file from extracted text or a preview. Report one result per file. An existing-name rejection must leave that file untouched and must not prevent truthful reporting of another file's result. Do not rename, overwrite or retry an uncertain write automatically. Verify downloads against the original bytes when available; matching a filename or byte count alone does not establish an exact transfer. The MCP inline-result limit can be lower than the adapter's 10 MiB file limit; inspect the actual transfer result and explain bounded coverage.