Microsoft OneDrive

Microsoft OneDrive via Graph: browse, search, delta sync, upload (simple + resumable), sharing, versions, recycle bin restore, and drive metadata.

# OneDrive Skillpack

Use this tool family for **Microsoft Graph `driveItem`** operations on the signed-in user’s OneDrive (consumer or OneDrive for Business, depending on the account).

## What is covered

These operations map to the main **file/folder** APIs Clono needs for agents: discovery, CRUD, sync, sharing, and large uploads. They are **not** the entire Microsoft Graph product surface (e.g. SharePoint site catalog, change notifications/subscriptions, Planner, Teams files) unless those are exposed as standard drive endpoints you already know.

**Always pass `driveId` from search/list/shared results** when calling item-scoped APIs if the item is not on the default drive.

## Operation index

| Area | Operations |
|------|------------|
| Account / drive | `one_drive_verify_credentials`, `one_drive_get_drive` |
| Browse | `one_drive_list_children`, `one_drive_list_children_by_path`, `one_drive_get_item`, `one_drive_get_by_path`, `one_drive_get_special_folder` |
| Discover | `one_drive_search`, `one_drive_shared_with_me`, `one_drive_recent`, `one_drive_delta` (root or folder via `item_id`) |
| Read content | `one_drive_get_file_text` (`.docx` / `.txt` text extraction), `one_drive_download_file_base64` (any type; `max_bytes` cap) |
| Write | `one_drive_create_folder`, `one_drive_upload_file` (simple, ~4 MiB class), `one_drive_create_upload_session` + `one_drive_upload_session_fragment` (large/resumable) |
| Update / move / copy | `one_drive_update_item`, `one_drive_move_item`, `one_drive_copy_item` (+ `one_drive_get_async_job_status` on `monitorUrl`) |
| Delete | `one_drive_delete_item` (recycle bin), `one_drive_permanent_delete_item` |
| Recycle | `one_drive_restore_deleted_item` (OneDrive **personal** in Graph v1; confirm for your tenant) |
| Versions | `one_drive_list_versions`, `one_drive_restore_version` |
| Sharing | `one_drive_list_permissions`, `one_drive_delete_permission`, `one_drive_create_link`, `one_drive_invite` |
| Media | `one_drive_get_thumbnails` |

## How to use it through Clono

1. Search operations: `GET /api/tools/search?q=onedrive`
2. Pick an operation from the `one_drive` tool family.
3. Start a run: `POST /api/tool-runs`
4. Poll: `GET /api/tool-runs/{runId}`

## Requirements

- The user must have connected OneDrive in Clono Integrations (`Files.ReadWrite.All` in the manifest).
- Preserve **file and folder ids** exactly; use **`driveId`** when returned.

## Shared folders and422 “not a folder”

Items shared from another drive often need **`driveId`** from **`search`**, **`sharedWithMe`**, or **`delta`** together with **`item_id`**. **`list_children_by_path`** only walks **`/me/drive/root`** and will not see those mounts.

If **`list_children`** still fails after **`driveId`** is set, **`one_drive_delta`** with the same **`item_id`** + **`drive_id`** can still enumerate descendants (Graph treats delta differently from **`/children`** on some item shapes).