Automate OneDrive file management, search, uploads, downloads, sharing, permissions, and folder operations via Rube MCP (Composio). Always search tools first for current schemas.
Add this skill
npx mdskills install sickn33/one-drive-automationComprehensive OneDrive automation with detailed workflows, parameters, and extensive pitfall documentation
1---2name: one-drive-automation3description: "Automate OneDrive file management, search, uploads, downloads, sharing, permissions, and folder operations via Rube MCP (Composio). Always search tools first for current schemas."4requires:5 mcp: [rube]6---78# OneDrive Automation via Rube MCP910Automate OneDrive operations including file upload/download, search, folder management, sharing links, permissions management, and drive browsing through Composio's OneDrive toolkit.1112## Prerequisites1314- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)15- Active OneDrive connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `one_drive`16- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas1718## Setup1920**Get Rube MCP**: Add `https://rube.app/mcp` as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.2122231. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds242. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `one_drive`253. If connection is not ACTIVE, follow the returned auth link to complete Microsoft OAuth264. Confirm connection status shows ACTIVE before running any workflows2728## Core Workflows2930### 1. Search and Browse Files3132**When to use**: User wants to find files or browse folder contents in OneDrive3334**Tool sequence**:351. `ONE_DRIVE_GET_DRIVE` - Verify drive access and get drive details [Prerequisite]362. `ONE_DRIVE_SEARCH_ITEMS` - Keyword search across filenames, metadata, and content [Required]373. `ONE_DRIVE_ONEDRIVE_LIST_ITEMS` - List all items in the root of a drive [Optional]384. `ONE_DRIVE_GET_ITEM` - Get detailed metadata for a specific item, expand children [Optional]395. `ONE_DRIVE_ONEDRIVE_FIND_FILE` - Find a specific file by exact name in a folder [Optional]406. `ONE_DRIVE_ONEDRIVE_FIND_FOLDER` - Find a specific folder by name [Optional]417. `ONE_DRIVE_LIST_DRIVES` - List all accessible drives [Optional]4243**Key parameters**:44- `q`: Search query (plain keywords only, NOT KQL syntax)45- `search_scope`: `"root"` (folder hierarchy) or `"drive"` (includes shared items)46- `top`: Max items per page (default 200)47- `skip_token`: Pagination token from `@odata.nextLink`48- `select`: Comma-separated fields to return (e.g., `"id,name,webUrl,size"`)49- `orderby`: Sort order (e.g., `"name asc"`, `"name desc"`)50- `item_id`: Item ID for `GET_ITEM`51- `expand_relations`: Array like `["children"]` or `["thumbnails"]` for `GET_ITEM`52- `user_id`: `"me"` (default) or specific user ID/email5354**Pitfalls**:55- `ONE_DRIVE_SEARCH_ITEMS` does NOT support KQL operators (`folder:`, `file:`, `filetype:`, `path:`); these are treated as literal text56- Wildcard characters (`*`, `?`) are NOT supported and are auto-removed; use file extension keywords instead (e.g., `"pdf"` not `"*.pdf"`)57- `ONE_DRIVE_ONEDRIVE_LIST_ITEMS` returns only root-level contents; use recursive `ONE_DRIVE_GET_ITEM` with `expand_relations: ["children"]` for deeper levels58- Large folders paginate; always follow `skip_token` / `@odata.nextLink` until exhausted59- Some drive ID formats may return "ObjectHandle is Invalid" errors due to Microsoft Graph API limitations6061### 2. Upload and Download Files6263**When to use**: User wants to upload files to OneDrive or download files from it6465**Tool sequence**:661. `ONE_DRIVE_ONEDRIVE_FIND_FOLDER` - Locate the target folder [Prerequisite]672. `ONE_DRIVE_ONEDRIVE_UPLOAD_FILE` - Upload a file to a specified folder [Required for upload]683. `ONE_DRIVE_DOWNLOAD_FILE` - Download a file by item ID [Required for download]694. `ONE_DRIVE_GET_ITEM` - Get file details before download [Optional]7071**Key parameters**:72- `file`: FileUploadable object with `s3key`, `mimetype`, and `name` for uploads73- `folder`: Destination path (e.g., `"/Documents/Reports"`) or folder ID for uploads74- `item_id`: File's unique identifier for downloads75- `file_name`: Desired filename with extension for downloads76- `drive_id`: Specific drive ID (for SharePoint or OneDrive for Business)77- `user_id`: `"me"` (default) or specific user identifier7879**Pitfalls**:80- Upload automatically renames on conflict (no overwrite option by default)81- Large files are automatically handled via chunking82- `drive_id` overrides `user_id` when both are provided83- Item IDs vary by platform: OneDrive for Business uses `01...` prefix, OneDrive Personal uses `HASH!NUMBER` format84- Item IDs are case-sensitive; use exactly as returned from API8586### 3. Share Files and Manage Permissions8788**When to use**: User wants to share files/folders or manage who has access8990**Tool sequence**:911. `ONE_DRIVE_ONEDRIVE_FIND_FILE` or `ONE_DRIVE_ONEDRIVE_FIND_FOLDER` - Locate the item [Prerequisite]922. `ONE_DRIVE_GET_ITEM_PERMISSIONS` - Check current permissions [Prerequisite]933. `ONE_DRIVE_INVITE_USER_TO_DRIVE_ITEM` - Grant access to specific users [Required]944. `ONE_DRIVE_CREATE_LINK` - Create a shareable link [Optional]955. `ONE_DRIVE_UPDATE_DRIVE_ITEM_METADATA` - Update item metadata [Optional]9697**Key parameters**:98- `item_id`: The file or folder to share99- `recipients`: Array of objects with `email` or `object_id`100- `roles`: Array with `"read"` or `"write"`101- `send_invitation`: `true` to send notification email, `false` for silent permission grant102- `require_sign_in`: `true` to require authentication to access103- `message`: Custom message for invitation (max 2000 characters)104- `expiration_date_time`: ISO 8601 date for permission expiry105- `retain_inherited_permissions`: `true` (default) to keep existing inherited permissions106107**Pitfalls**:108- Using wrong `item_id` with `INVITE_USER_TO_DRIVE_ITEM` changes permissions on unintended items; always verify first109- Write or higher roles are impactful; get explicit user confirmation before granting110- `GET_ITEM_PERMISSIONS` returns inherited and owner entries; do not assume response only reflects recent changes111- `permissions` cannot be expanded via `ONE_DRIVE_GET_ITEM`; use the separate permissions endpoint112- At least one of `require_sign_in` or `send_invitation` must be `true`113114### 4. Manage Folders (Create, Move, Delete, Copy)115116**When to use**: User wants to create, move, rename, delete, or copy files and folders117118**Tool sequence**:1191. `ONE_DRIVE_ONEDRIVE_FIND_FOLDER` - Locate source and destination folders [Prerequisite]1202. `ONE_DRIVE_ONEDRIVE_CREATE_FOLDER` - Create a new folder [Required for create]1213. `ONE_DRIVE_MOVE_ITEM` - Move a file or folder to a new location [Required for move]1224. `ONE_DRIVE_COPY_ITEM` - Copy a file or folder (async operation) [Required for copy]1235. `ONE_DRIVE_DELETE_ITEM` - Move item to recycle bin [Required for delete]1246. `ONE_DRIVE_UPDATE_DRIVE_ITEM_METADATA` - Rename or update item properties [Optional]125126**Key parameters**:127- `name`: Folder name for creation or new name for rename/copy128- `parent_folder`: Path (e.g., `"/Documents/Reports"`) or folder ID for creation129- `itemId`: Item to move130- `parentReference`: Object with `id` (destination folder ID) for moves: `{"id": "folder_id"}`131- `item_id`: Item to copy or delete132- `parent_reference`: Object with `id` and optional `driveId` for copy destination133- `@microsoft.graph.conflictBehavior`: `"fail"`, `"replace"`, or `"rename"` for copies134- `if_match`: ETag for optimistic concurrency on deletes135136**Pitfalls**:137- `ONE_DRIVE_MOVE_ITEM` does NOT support cross-drive moves; use `ONE_DRIVE_COPY_ITEM` for cross-drive transfers138- `parentReference` for moves requires folder ID (not folder name); resolve with `ONEDRIVE_FIND_FOLDER` first139- `ONE_DRIVE_COPY_ITEM` is asynchronous; response provides a URL to monitor progress140- `ONE_DRIVE_DELETE_ITEM` moves to recycle bin, not permanent deletion141- Folder creation auto-renames on conflict (e.g., "New Folder" becomes "New Folder 1")142- Provide either `name` or `parent_reference` (or both) for `ONE_DRIVE_COPY_ITEM`143144### 5. Track Changes and Drive Information145146**When to use**: User wants to monitor changes or get drive/quota information147148**Tool sequence**:1491. `ONE_DRIVE_GET_DRIVE` - Get drive properties and metadata [Required]1502. `ONE_DRIVE_GET_QUOTA` - Check storage quota (total, used, remaining) [Optional]1513. `ONE_DRIVE_LIST_SITE_DRIVE_ITEMS_DELTA` - Track changes in SharePoint site drives [Optional]1524. `ONE_DRIVE_GET_ITEM_VERSIONS` - Get version history of a file [Optional]153154**Key parameters**:155- `drive_id`: Drive identifier (or `"me"` for personal drive)156- `site_id`: SharePoint site identifier for delta tracking157- `token`: Delta token (`"latest"` for current state, URL for next page, or timestamp)158- `item_id`: File ID for version history159160**Pitfalls**:161- Delta queries are only available for SharePoint site drives via `ONE_DRIVE_LIST_SITE_DRIVE_ITEMS_DELTA`162- Token `"latest"` returns current delta token without items (useful as starting point)163- Deep or large drives can take several minutes to crawl; use batching and resume logic164165## Common Patterns166167### ID Resolution168- **User**: Use `"me"` for authenticated user or specific user email/GUID169- **Item ID from find**: Use `ONE_DRIVE_ONEDRIVE_FIND_FILE` or `ONE_DRIVE_ONEDRIVE_FIND_FOLDER` to get item IDs170- **Item ID from search**: Extract from `ONE_DRIVE_SEARCH_ITEMS` results171- **Drive ID**: Use `ONE_DRIVE_LIST_DRIVES` or `ONE_DRIVE_GET_DRIVE` to discover drives172- **Folder path to ID**: Use `ONE_DRIVE_ONEDRIVE_FIND_FOLDER` with path, then extract ID from response173174ID formats vary by platform:175- OneDrive for Business/SharePoint: `01NKDM7HMOJTVYMDOSXFDK2QJDXCDI3WUK`176- OneDrive Personal: `D4648F06C91D9D3D!54927`177178### Pagination179OneDrive uses token-based pagination:180- Follow `@odata.nextLink` or `skip_token` until no more pages181- Set `top` for page size (varies by endpoint)182- `ONE_DRIVE_ONEDRIVE_LIST_ITEMS` auto-handles pagination internally183- Aggressive parallel requests can trigger HTTP 429; honor `Retry-After` headers184185### Path vs ID186Most OneDrive tools accept either paths or IDs:187- **Paths**: Start with `/` (e.g., `"/Documents/Reports"`)188- **IDs**: Use unique item identifiers from API responses189- **Item paths for permissions**: Use `:/path/to/item:/` format190191## Known Pitfalls192193### ID Formats194- Item IDs are case-sensitive and platform-specific195- Never use web URLs, sharing links, or manually constructed identifiers as item IDs196- Always use IDs exactly as returned from Microsoft Graph API197198### Rate Limits199- Aggressive parallel `ONE_DRIVE_GET_ITEM` calls can trigger HTTP 429 Too Many Requests200- Honor `Retry-After` headers and implement throttling201- Deep drive crawls should use batching with delays202203### Search Limitations204- No KQL support; use plain keywords only205- No wildcard characters; use extension keywords (e.g., `"pdf"` not `"*.pdf"`)206- No path-based filtering in search; use folder listing instead207- `q='*'` wildcard-only queries return HTTP 400 invalidRequest208209### Parameter Quirks210- `drive_id` overrides `user_id` when both are provided211- `permissions` cannot be expanded via `GET_ITEM`; use dedicated permissions endpoint212- Move operations require folder IDs in `parentReference`, not folder names213- Copy operations are asynchronous; response provides monitoring URL214215## Quick Reference216217| Task | Tool Slug | Key Params |218|------|-----------|------------|219| Search files | `ONE_DRIVE_SEARCH_ITEMS` | `q`, `search_scope`, `top` |220| List root items | `ONE_DRIVE_ONEDRIVE_LIST_ITEMS` | `user_id`, `select`, `top` |221| Get item details | `ONE_DRIVE_GET_ITEM` | `item_id`, `expand_relations` |222| Find file by name | `ONE_DRIVE_ONEDRIVE_FIND_FILE` | `name`, `folder` |223| Find folder by name | `ONE_DRIVE_ONEDRIVE_FIND_FOLDER` | `name`, `folder` |224| Upload file | `ONE_DRIVE_ONEDRIVE_UPLOAD_FILE` | `file`, `folder` |225| Download file | `ONE_DRIVE_DOWNLOAD_FILE` | `item_id`, `file_name` |226| Create folder | `ONE_DRIVE_ONEDRIVE_CREATE_FOLDER` | `name`, `parent_folder` |227| Move item | `ONE_DRIVE_MOVE_ITEM` | `itemId`, `parentReference` |228| Copy item | `ONE_DRIVE_COPY_ITEM` | `item_id`, `parent_reference`, `name` |229| Delete item | `ONE_DRIVE_DELETE_ITEM` | `item_id` |230| Share with users | `ONE_DRIVE_INVITE_USER_TO_DRIVE_ITEM` | `item_id`, `recipients`, `roles` |231| Create share link | `ONE_DRIVE_CREATE_LINK` | `item_id`, link type |232| Get permissions | `ONE_DRIVE_GET_ITEM_PERMISSIONS` | `item_id` |233| Update metadata | `ONE_DRIVE_UPDATE_DRIVE_ITEM_METADATA` | `item_id`, fields |234| Get drive info | `ONE_DRIVE_GET_DRIVE` | `drive_id` |235| List drives | `ONE_DRIVE_LIST_DRIVES` | user/group/site scope |236| Get quota | `ONE_DRIVE_GET_QUOTA` | (none) |237| Track changes | `ONE_DRIVE_LIST_SITE_DRIVE_ITEMS_DELTA` | `site_id`, `token` |238| Version history | `ONE_DRIVE_GET_ITEM_VERSIONS` | `item_id` |239
Full transparency — inspect the skill content before installing.