OneDrive Files

Security

Browse, search, download, and share OneDrive files, create folders, upload files, and manage file actions via Microsoft Graph. Use this skill when users want to manage OneDrive files, SharePoint documents, sharing links, and drive metadata using the Microsoft Graph API.

Install

openclaw skills install onedrive-files

OneDrive Files

OneDrive Files

Access OneDrive and SharePoint via Microsoft Graph API with managed OAuth authentication. Browse files, search folders, inspect details, create folders, share links, upload files, and manage drive metadata.

This skill uses ClawLink for hosted connection flows and credentials so you do not need to configure Microsoft Graph access yourself.

Setup in 3 Steps

Step 1: InstallStep 2: Pair AccountStep 3: Connect OneDrive
InstallPairApp-specific connection GIF coming soon
Run the install command in OpenClawSign in and approve the deviceOpen the dashboard and connect OneDrive

How It Works

┌─────────────────┐     ┌──────────────┐     ┌──────────────────┐
│   OpenClaw      │────▶│   ClawLink   │────▶│ Microsoft Graph  │
│   (User Chat)   │     │   (OAuth)    │     │   (OneDrive API) │
└─────────────────┘     └──────────────┘     └──────────────────┘
          │                       │                       │
          │  1. Install Plugin   │                       │
          │  2. Pair Device      │                       │
          │  3. Connect OneDrive  │                       │
          │                      │  4. Secure Token      │
          │                      │  5. Proxy Requests    │
          │                      │                       │
          ▼                      ▼                       ▼
    ┌──────────┐           ┌──────────┐           ┌──────────┐
    │  SKILL   │           │ Dashboard│           │ OneDrive│
    │  File    │           │ Auth     │           │ /SharePt│
    └──────────┘           └──────────┘           └──────────┘

Install

Install the verified ClawLink plugin from ClawHub. After the user confirms, complete the full setup so ClawLink tools are visible in the next OpenClaw chat.

openclaw plugins install clawhub:clawlink-plugin
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart

Then tell the user: "OpenClaw has been restarted. Send /new as a standalone message to start a fresh chat, then ask for OneDrive again."

Quick Start

# List items in OneDrive root
clawlink_call_tool --tool "one_drive_onedrive_list_items" --params '{}'

# Search for files
clawlink_call_tool --tool "one_drive_search_items" --params '{"query": "report.xlsx"}'

# Get file metadata
clawlink_call_tool --tool "one_drive_get_item" --params '{"item_id": "FILE_ID"}'

Authentication

All OneDrive tool calls are authenticated automatically by ClawLink using the user's connected Microsoft account.

No API key is required in chat. ClawLink stores the OAuth token securely and injects it into every Microsoft Graph request on the user's behalf.

Getting Connected

  1. Install the ClawLink plugin (see Install above).
  2. Pair the plugin with clawlink_begin_pairing if it is not configured yet.
  3. Open https://claw-link.dev/dashboard?add=onedrive and connect OneDrive.
  4. Call clawlink_list_integrations to verify the connection is active.

Connection Management

List Connections

clawlink_list_integrations

Response: Returns all connected integrations. Look for onedrive in the list.

Verify Connection

clawlink_list_tools --integration onedrive

Response: Returns the live tool catalog for OneDrive.

Reconnect

If OneDrive tools are missing or the connection shows an error:

  1. Direct the user to https://claw-link.dev/dashboard?add=onedrive
  2. After they confirm, call clawlink_list_integrations to verify
  3. Then call clawlink_list_tools --integration onedrive

Security& Permissions

  • Access is scoped to files, folders, and drive data within the connected Microsoft account.
  • All write operations require explicit user confirmation. Before executing any create, update, or delete call, confirm the target resource and intended effect with the user.
  • Destructive actions (delete file, remove sharing permission) must be confirmed.
  • Sharing link creation grants external access — confirm the recipient and permission level.

Tool Reference

Drive & Item Operations

ToolDescriptionMode
one_drive_list_drivesList all drives accessible to the authenticated userRead
one_drive_get_driveGet drive properties by IDRead
one_drive_get_rootGet the root folder of the user's OneDriveRead
one_drive_get_itemGet file or folder metadata by IDRead
one_drive_get_item_permissionsList permissions on a file or folderRead
one_drive_get_item_thumbnailsGet thumbnail URLs for a fileRead
one_drive_get_item_versionsGet version history of a fileRead
one_drive_list_folder_childrenList contents of a folder by ID or pathRead
one_drive_list_root_drive_changesTrack changes in the drive root via delta tokenRead
one_drive_search_itemsSearch files and folders by keywordRead
one_drive_get_recent_itemsGet recently accessed filesRead
one_drive_get_shared_itemsGet items shared with the userRead
one_drive_preview_drive_itemGenerate a short-lived preview URL for a fileRead

File & Folder Management

ToolDescriptionMode
one_drive_onedrive_list_itemsList files and folders in OneDrive rootRead
one_drive_onedrive_find_fileFind a file in a specific folderRead
one_drive_onedrive_find_folderFind folders by nameRead
one_drive_onedrive_create_folderCreate a new folder in OneDriveWrite
one_drive_onedrive_create_text_fileCreate a text file in OneDriveWrite
one_drive_onedrive_upload_fileUpload a file to OneDriveWrite
one_drive_move_itemMove a file or folder to a new locationWrite
one_drive_copy_itemCopy a file or folder to a new locationWrite
one_drive_update_drive_item_metadataUpdate file/folder metadata (rename, move)Write
one_drive_update_file_contentUpdate file content via upload sessionWrite
one_drive_delete_itemDelete a file or folder (moves to recycle bin)Write
one_drive_delete_item_permanentlyPermanently delete a file or folderWrite

Sharing & Permissions

ToolDescriptionMode
one_drive_create_linkCreate a sharing link for a file or folderWrite
one_drive_invite_user_to_itemInvite a user to access a file or folderWrite
one_drive_grant_share_permissionGrant access via a sharing URLWrite
one_drive_create_item_permissionCreate a permission on an itemWrite
one_drive_delete_item_permissionRemove a permission from an itemWrite
one_drive_update_drive_items_permissionsUpdate permission rolesWrite
one_drive_list_share_permissionsList permissions from a sharing URLRead

Check In / Check Out

ToolDescriptionMode
one_drive_checkout_itemCheck out a file to prevent others from editingWrite
one_drive_checkin_itemCheck in a previously checked-out fileWrite
one_drive_discard_checkoutDiscard checkout and discard changesWrite

Site & SharePoint Operations

ToolDescriptionMode
one_drive_get_siteGet SharePoint site metadataRead
one_drive_get_site_page_contentGet SharePoint site page contentRead
one_drive_list_site_listsList SharePoint lists in a siteRead
one_drive_list_site_subsitesList subsites of a SharePoint siteRead
one_drive_list_site_columnsList column definitions for a SharePoint siteRead
one_drive_get_sharepoint_list_itemsGet items from a SharePoint listRead
one_drive_get_group_driveGet the document library for a Microsoft 365 groupRead

Download & Conversion

ToolDescriptionMode
one_drive_download_fileDownload a file by ID (returns S3 URL)Read
one_drive_download_file_by_pathDownload a file by pathRead
one_drive_download_item_as_formatDownload a file converted to PDF or HTMLRead
one_drive_download_item_versionDownload a specific previous version of a fileRead

Following & Activity

ToolDescriptionMode
one_drive_follow_itemFollow a file or folderWrite
one_drive_unfollow_itemStop following a file or folderWrite
one_drive_get_followed_itemGet a followed itemRead
one_drive_list_activitiesGet recent activity on the driveRead
one_drive_list_item_activitiesGet activities for a specific itemRead

Sharing URL Resolution

ToolDescriptionMode
one_drive_get_drive_item_by_sharing_urlResolve a sharing URL to item metadataRead
one_drive_get_shareGet a shared item by share IDRead

Code Examples

List files in a folder

clawlink_call_tool --tool "one_drive_list_folder_children" \
  --params '{
    "item_id": "FOLDER_ID"
  }'

Search for files

clawlink_call_tool --tool "one_drive_search_items" \
  --params '{
    "query": "quarterly report",
    "filter": "file neq null"
  }'

Create a sharing link

clawlink_call_tool --tool "one_drive_create_link" \
  --params '{
    "item_id": "FILE_ID",
    "type": "view",
    "scope": "organization"
  }'

Upload a file

clawlink_call_tool --tool "one_drive_onedrive_upload_file" \
  --params '{
    "parent_folder_id": "FOLDER_ID",
    "file_name": "document.pdf",
    "file_content": "BASE64_ENCODED_CONTENT"
  }'

Move a file

clawlink_call_tool --tool "one_drive_move_item" \
  --params '{
    "item_id": "FILE_ID",
    "parent_folder_id": "NEW_FOLDER_ID"
  }'

Discovery Workflow

  1. Call clawlink_list_integrations to confirm OneDrive is connected.
  2. Call clawlink_list_tools --integration onedrive to see the live catalog.
  3. Treat the returned list as the source of truth. Do not guess or assume what tools exist.
  4. If the user describes a capability but the exact tool is unclear, call clawlink_search_tools with a short query and integration onedrive.
  5. If no OneDrive tools appear, direct the user to https://claw-link.dev/dashboard?add=onedrive.

Execution Workflow

┌─────────────────────────────────────────────────────────────┐
│  READ OPERATIONS (Safe)                                     │
│  list → get → search → describe → call                      │
│                                                             │
│  Example: List folder → Get file → Show metadata           │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│  WRITE OPERATIONS (Require Confirmation)                     │
│  list → get → describe → preview → confirm → call           │
│                                                             │
│  Example: Describe tool → Preview changes → User approves   │
│           → Execute update                                  │
└─────────────────────────────────────────────────────────────┘
  1. For unfamiliar tools, ambiguous requests, or any write action, call clawlink_describe_tool first.
  2. Use the returned guidance, schema, whenToUse, askBefore, safeDefaults, examples, and followups to shape the call.
  3. Prefer read, list, search, and get operations before writes when that reduces ambiguity.
  4. For writes or anything marked as requiring confirmation, call clawlink_preview_tool first.
  5. Execute with clawlink_call_tool. Pass confirmation only after the preview matches the user's intent.
  6. If the tool call fails, report the real error. Do not invent results or restate the failure as a missing capability unless the live catalog supports that conclusion.

Notes

  • Item IDs containing { and } must be URL-encoded (%7B and %7D) in raw Graph URLs. ClawLink handles this automatically.
  • Large file uploads (>4 MB) use chunked upload sessions — do not assume the upload is complete immediately.
  • Deleted items are moved to the recycle bin, not permanently deleted, unless using delete_item_permanently.
  • Sharing links have independent availability — thumbnail URLs are external HTTP endpoints.
  • Rate limit errors (HTTP 429) include a Retry-After header — use exponential backoff.

Error Handling

Status / ErrorMeaning
Tool not foundThe tool name does not exist in the current catalog. Verify with clawlink_list_tools --integration onedrive.
Missing connectionOneDrive is not connected. Direct the user to https://claw-link.dev/dashboard?add=onedrive.
ItemNotFoundFile or folder does not exist. Check the item_id or path.
nameAlreadyExistsA file or folder with that name already exists at the destination.
InvalidArgumentInvalid parameter or missing required field. Review the tool schema with clawlink_describe_tool.
Write rejectedUser did not confirm a write action. Always confirm before executing writes.

Troubleshooting: Tools Not Visible

  1. Check that the ClawLink plugin is installed:
    openclaw plugins list
    
  2. If the plugin is installed but tools are missing, tell the user to send /new as a standalone message to reload the catalog.
  3. If a fresh chat does not help, run:
    openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
    openclaw gateway restart
    
  4. After restart, tell the user to send /new again and retry.

Troubleshooting: Invalid Tool Call

  1. Ensure the integration slug is exactly onedrive.
  2. Use clawlink_describe_tool to verify parameter names and types before calling.
  3. For write operations, always call clawlink_preview_tool first.

Resources

Related Skills


Powered by ClawLink — an integration hub for OpenClaw

ClawLink Logo