Skip to content
All tools

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

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.

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"
    }
  },
  "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. 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.

Required inputs

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.

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",
      "type": "string"
    }
  },
  "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"
}