onedrive_delete_file
OneDrive · macOS · Windows
Effect: delete (strongest supported action). Status: gated.
Gated means the tool requires an installed app, a connected account, permission, or runtime availability. Check those requirements on the listed platform before using it.
macOS
Purpose
Permanently deletes a file or an EMPTY folder inside the OneDrive folder synced on this Mac. It is not moved to the Mac's Trash, and OneDrive syncs the deletion to the cloud. Refuses a folder that still has items inside (it says how many) and any path outside a OneDrive folder. Called without confirm it returns a preview; pass confirm=true to delete. If OneDrive Files-On-Demand restores the item, the tool reports that the delete did not take instead of claiming success. Get the path from onedrive_list_files or onedrive_search_files.
Required inputs
path— Absolute path to the file or folder
Permissions and confirmation
Explicit confirmation parameter: inspect the schema and tool description before any real call. The documentation example keeps confirm false. Obtain user authorization before performing the action.
- Use only the apps, accounts and resources authorized by the user on this platform. Consult this tool's platform-specific description for its connection and permission requirements; this catalog does not assert additional OAuth scopes or OS entitlements.
Full input schema — macOS
{
"properties": {
"confirm": {
"description": "Must be true to delete",
"type": "boolean"
},
"path": {
"description": "Absolute path to the file or folder",
"type": "string"
},
"remember": {
"description": "With confirm: true, also stop asking for this kind of action from now on. Only when the person said so (\"don't ask again\"). The person can revoke it in LMCP or with set_always_allowed.",
"type": "boolean"
}
},
"required": [
"path"
],
"type": "object"
}Documentation example
Do not execute this example. These concrete inputs refer to a fictional demonstration dataset. Resolve real handles and obtain user authorization before any real call.
{
"confirm": false,
"path": "/Users/demo/OneDrive-Demo/Documents/meeting-notes.txt"
}Windows
Purpose
Deletes one file, or one empty folder, from the local disk (without a Microsoft 365 account it acts on the local path and never calls the OneDrive service). The path must be inside a OneDrive folder (onedrive_root lists them, onedrive_list_files and onedrive_search_files give paths in them): anything else, and a OneDrive folder itself, is refused with or without confirm. A path that does not exist, and a folder that still has items, are refused with or without confirm. Without confirm=true nothing is deleted: the call returns a preview that names the path and says file or folder. With confirm=true the item is removed directly, not sent to the Recycle Bin, and this server has no tool to restore it; what the OneDrive sync client then does with the deletion is outside this tool. To delete a folder with items, delete its contents first, one call each. With a Microsoft 365 account connected it acts on that account's OneDrive through Microsoft Graph instead (paths inside the drive, like Documents/report.docx): an overwritten file keeps its old version in OneDrive's version history, a written file may be up to 4 MB, a deleted item goes to the OneDrive recycle bin, and a move needs the destination's folder to exist.
Required inputs
path— Absolute path to the file or folder to delete (with a Microsoft 365 account: a path inside the drive)
Permissions and confirmation
Explicit confirmation parameter: inspect the schema and tool description before any real call. The documentation example keeps confirm false. Obtain user authorization before performing the action.
- Use only the apps, accounts and resources authorized by the user on this platform. Consult this tool's platform-specific description for its connection and permission requirements; this catalog does not assert additional OAuth scopes or OS entitlements.
Full input schema — Windows
{
"properties": {
"confirm": {
"description": "Must be true to execute the delete",
"type": "boolean"
},
"path": {
"description": "Absolute path to the file or folder to delete (with a Microsoft 365 account: a path inside the drive)",
"type": "string"
},
"remember": {
"description": "With confirm=true, and only after the person said so: do this kind of action without asking from now on («don't ask me again»). The preview names the family.",
"type": "boolean"
}
},
"required": [
"path"
],
"type": "object"
}Documentation example
Do not execute this example. These concrete inputs refer to a fictional demonstration dataset. Resolve real handles and obtain user authorization before any real call.
{
"confirm": false,
"path": "Documents/meeting-notes.txt"
}