Delete File or Folder
delete_drive_itemDelete a file or folder from OneDrive or a SharePoint document library so it moves to the recycle bin with its contents and can be restored.
Instructions
Delete a file or folder in OneDrive or a SharePoint document library. It goes to the recycle bin, with a folder's contents, and can be restored from there.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"item_id": "<item_id>"
},
"name": "delete_drive_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_id | Yes | ID of the file or folder to delete | |
| drive_id | No | SharePoint document library ID from list_site_drives. Omit for your own OneDrive | |
| if_match | No | eTag from get_drive_item or list_drive_items. The change happens only if the item hasn't changed since; otherwise it fails with precondition-failed and nothing changes |