Browse, upload, move, share and search files in Microsoft OneDrive via the Microsoft Graph drive API.
Microsoft OneDrive ships in the w6w first-party pack. It declares 18 actions, 3 health checks, and the host runs its code in a sandbox that never sees the credential.
io.w6w.onedriveMicrosoft OneDrive stores a user’s files, and this app browses, uploads, shares and searches them through the Microsoft Graph drive API — the same surface behind OneDrive personal and business accounts and SharePoint document libraries alike.
It covers everyday file management: listing folder contents, reading and searching for items across a whole drive, creating folders, uploading text-based files, and copying, moving, renaming or deleting an item once you’ve found it. Sharing actions create OneDrive’s own view or edit links, list and remove existing permissions, and send a direct sharing invite to a specific person by email. A change-tracking action reports what has been added, updated or removed since a previous run, which is the only way to detect a deletion — a simple listing can’t.
This app works across a user’s personal drive, a colleague’s shared drive, or a SharePoint library, all addressed the same way. A live check reports remaining storage headroom directly from OneDrive’s own quota data, alongside a credential check, since Microsoft publishes no general status page for the service itself.
Three routes to the same 18 actions. The Workflow tab is generated from Microsoft OneDrive's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.
copy-item Start an asynchronous copy of a file or folder. Returns 202 and the monitor URL; the copy is not finished when this action returns.
create-link Create a sharing link for a file or folder, or return the existing link for the same settings.
delete-item Delete a file or folder, moving it to the recycle bin. Deleting a folder deletes its contents.
delete-permission Revoke one sharing permission from a file or folder — a link, or a person's access.
get-download-url Return a short-lived, pre-authenticated download URL for a file, plus its name, size and MIME type. Returns the URL rather than the bytes — see the README.
get-drive Read one drive's metadata, including its storage quota facet and its driveType (personal, business or documentLibrary).
get-item Read one file or folder's metadata. Addressed by id or by path — the usual way to turn a path into a stable item id.
list-changes Track additions, updates and deletions across a whole drive using Graph delta query. Deletions appear as items carrying a `deleted` facet.
list-children List the files and folders directly inside a folder, or inside the drive root when no item is addressed.
list-drives List the drives the signed-in user can reach — their own OneDrive plus any SharePoint document libraries — and return the ids the other actions address.
list-permissions List the sharing permissions on a file or folder. Entries carrying `inheritedFrom` are inherited from an ancestor and cannot be deleted here.
list-shared-with-me List the files and folders other people have shared with the signed-in user. Read the `remoteItem` facet for the drive id and item id that address the original.
move-item Move a file or folder into another folder, optionally renaming it on the way. The item keeps its id.
search-items Search a drive for files and folders. Matches filename, metadata and file content — it is a search, not a filename filter.
send-sharing-invite Grant named people access to a file or folder, with or without emailing them an invitation.
upload-file Upload text content as a new file, or replace an existing file's contents, in a single request. Up to 250 MB; text only.
A workflow step names the app and the action, and the editor fills in the
connection when you pick one. This is the Step shape from the
workflow spec, carrying Microsoft OneDrive's real ids.
{
"manifestVersion": "2",
"name": "onedrive-example",
"steps": [
{
"id": "create-folder",
"uses": {
"app": "io.w6w.onedrive",
"action": "create-folder",
"connection": "conn_YOUR_CONNECTION_ID"
},
"with": {
"name": "<name>"
}
}
]
}create-folder copy-item create-link get-download-url get-drive +13 more actions available
Every app-specific value here is a blank you have to fill in. An
app action is reached through the connection that authenticates it, so the
address is a connection id, not the app id — and connections belong to your account,
so a public page cannot know yours. Create one for Microsoft OneDrive, then fill in
the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the
parameters that action declares. The call itself is real — the shape is transcribed
from the studio's own snippet builder, which prints the same kind of blanks — but
nothing in it is specific to Microsoft OneDrive. The Workflow tab is where this app's
real ids are.
npm install @w6w/sdkyarn add @w6w/sdkpnpm add @w6w/sdkdeno add npm:@w6w/sdkimport { W6wClient, isActionRun } from "@w6w/sdk";
// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();
const envelope = await client.run({
urn: "conn_YOUR_CONNECTION_ID",
action: "upload-file",
payload: {
// driveId: "<value>",
// itemId: "<value>",
// itemPath: "<value>",
// name: "<value>",
content: "<value>",
// contentType: "<value>",
},
});
if (isActionRun(envelope)) console.log(envelope.value); npm install -g @w6w/cli w6w run conn_YOUR_CONNECTION_ID --action upload-file --payload '{"content":"<value>"}' Give an AI agent Microsoft OneDrive — without giving it Microsoft OneDrive's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.
One tool call{
"name": "w6w_invoke",
"arguments": {
"ref": "app:io.w6w.onedrive#create-folder",
"input": {
"name": "<name>"
}
}
}
Every tool names its target with a single ref. The
app: form above doesn't name a connection at all — the
host resolves which of the caller's Microsoft OneDrive connections to sign
with, and refuses rather than guesses when the answer is ambiguous.
The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.
Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.
Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.
Microsoft OneDrive's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.
The MCP surface is part of the hosted platform. Microsoft OneDrive itself is MIT, and the runtime that executes it is source-available (FSL).
Microsoft OneDrive declares its own checks, so its health is a property of the app rather than something the host guesses at.
Bytes left on the drive behind this connection, read from the `quota` facet of `GET /me/drive`. Reports the vendor's own `state` (normal / nearing / critical / exceeded) rather than re-deriving one.