← ClaudeAtlas

microsoft-onedrivelisted

Read and manage OneDrive / SharePoint files via Microsoft Graph. Use when the user mentions OneDrive files / folders, SharePoint documents, file uploads / downloads, sharing links, or "my drive".
AceDataCloud/Skills · ★ 8 · AI & Automation · score 71
Install: claude install-skill AceDataCloud/Skills
Drive Microsoft Graph for OneDrive / SharePoint via `curl + jq`. The user's OAuth bearer token is in `$MICROSOFT_ONEDRIVE_TOKEN`; every call needs it as `Authorization: Bearer $MICROSOFT_ONEDRIVE_TOKEN`. The token already carries the OneDrive scopes the user agreed to at install time (`Files.Read`, `Files.Read.All`, optionally `Files.ReadWrite.All`, `Sites.Read.All`). The Graph API returns standard JSON; failures surface as JSON `{"error": {"code": "...", "message": "..."}}` — show that error verbatim to the user. **Always start with `/me`** to confirm the connection works AND learn which account / drive you're operating against. ## Recipes ### Verify auth (always run first) ```sh curl -sS -H "Authorization: Bearer $MICROSOFT_ONEDRIVE_TOKEN" \ https://graph.microsoft.com/v1.0/me \ | jq '{displayName, mail, userPrincipalName}' ``` If you get `401 InvalidAuthenticationToken`, the token expired — report it; the user has to reinstall the connector. ### List files in root ```sh curl -sS -H "Authorization: Bearer $MICROSOFT_ONEDRIVE_TOKEN" \ "https://graph.microsoft.com/v1.0/me/drive/root/children?\$top=20&\$select=id,name,size,lastModifiedDateTime,folder,file" \ | jq '.value[] | {id, name, size, kind: (if .folder then "folder" else .file.mimeType end), modified: .lastModifiedDateTime}' ``` Folders have `"folder":{"childCount":N}`, files have `"file":{"mimeType":"..."}`. ### List files in a sub-folder by path ```sh curl -sS -H "Authorization: Bearer $MICROSOFT_ON