Microsoft 365 Files
v0.2.2Microsoft 365 OneDrive files via Graph: list, search, get, upload, download, share, read text.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_files
List files and folders in OneDrive. Defaults to root folder.
| Parameter | Type | Description |
|---|---|---|
path | string | Folder path (e.g., "/Documents") or item ID |
top | integer | Max items to return (default: 50) |
get_file
Get metadata for a specific file or folder.
| Parameter | Type | Description |
|---|---|---|
path | string | File path or item ID |
download_file
Get a download URL for a file (valid for short period).
| Parameter | Type | Description |
|---|---|---|
path | string | File path or item ID |
search_files
Search for files in OneDrive by name or content.
| Parameter | Type | Description |
|---|---|---|
query | string | Search query |
top | integer | Max results (default: 25) |
upload_file
Upload a file to OneDrive. Text content up to 4MB; binary content as base64 up to 10MB (uploads over 4MB use a resumable upload session).
| Parameter | Type | Description |
|---|---|---|
content | string | File content (text, or base64 when encoding is "base64") |
encoding | string | Content encoding (default: utf8). Use "base64" for binary files. |
path | string | Destination path including filename (e.g., "/Documents/note.txt") |
create_folder
Create a new folder in OneDrive.
| Parameter | Type | Description |
|---|---|---|
path | string | Full path for new folder (e.g., "/Documents/NewFolder") |
delete_file
Delete a file or folder from OneDrive.
| Parameter | Type | Description |
|---|---|---|
path | string | File/folder path or item ID |
move_file
Move a file or folder to a new location.
| Parameter | Type | Description |
|---|---|---|
destinationPath | string | New parent folder path |
newName | string | Optional new name |
sourcePath | string | Current file/folder path or ID |
copy_file
Copy a file or folder to a new location.
| Parameter | Type | Description |
|---|---|---|
destinationPath | string | Destination folder path |
newName | string | Optional new name |
sourcePath | string | Current file/folder path or ID |
get_recent
Get recently accessed files.
| Parameter | Type | Description |
|---|---|---|
top | integer | Max items (default: 25) |
read_text_file
Read the contents of a text file directly.
| Parameter | Type | Description |
|---|---|---|
maxSize | integer | Max bytes to read (default: 100KB) |
path | string | File path or ID |
invite_to_file
Share a file or folder with specific people by email (grants read or write permission).
| Parameter | Type | Description |
|---|---|---|
message | string | Optional note included in the sharing invitation |
path | string | File/folder path or item ID |
recipients | array | Email addresses to share with |
role | string | Permission to grant (default: read) |
sendInvitation | boolean | Email the recipients about the share (default: false) |
list_file_permissions
List the sharing permissions granted on a file or folder.
| Parameter | Type | Description |
|---|---|---|
path | string | File/folder path or item ID |
revoke_file_permission
Revoke a sharing permission from a file or folder. Use list_file_permissions to find the permission ID.
| Parameter | Type | Description |
|---|---|---|
path | string | File/folder path or item ID |
permissionId | string | Permission ID from list_file_permissions |
list_file_versions
List the version history of a file.
| Parameter | Type | Description |
|---|---|---|
path | string | File path or item ID |
restore_file_version
Restore a previous version of a file, replacing the current content. Use list_file_versions to find the version ID.
| Parameter | Type | Description |
|---|---|---|
path | string | File path or item ID |
versionId | string | Version ID from list_file_versions |
list_file_activities
List recent activity in your OneDrive, or on a specific file or folder when a path is given. Requires OneDrive for Business or SharePoint; personal OneDrive accounts do not expose activity history.
| Parameter | Type | Description |
|---|---|---|
path | string | File/folder path or item ID (omit for drive-wide activity) |
read_document
Extract the text of a Word (.docx) or PowerPoint (.pptx) document directly, without downloading it. Use read_text_file for plain-text files.
| Parameter | Type | Description |
|---|---|---|
maxChars | integer | Max extracted characters to return (default: 100000) |
maxSize | integer | Max file bytes to download (default: 20MB) |
path | string | Document path or item ID |