Copy File or Folder
copy_drive_itemCopies a file or folder, with a folder's contents, into a OneDrive or SharePoint document library folder. Name clashes fail unless conflict_behavior is set to rename.
Instructions
Copy a file or folder, with a folder's contents, to a folder in OneDrive or any SharePoint document library. Graph copies in the background, so the copy may take a while to appear. Never overwrites: a name clash fails unless conflict_behavior is rename.
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>",
"destination_folder_id": "<destination_folder_id>"
},
"name": "copy_drive_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_id | Yes | ID of the file or folder to copy | |
| drive_id | No | SharePoint document library ID the item is in, from list_site_drives. Omit for your own OneDrive | |
| new_name | No | Name for the copy, including its extension. Omit to keep the name | |
| conflict_behavior | No | On a name clash: "fail" (default) or "rename", which adds a number to the copy's name. Not supported on personal OneDrive | |
| destination_drive_id | No | Drive ID to copy into, when it differs from the item's own drive. To copy from SharePoint into your own OneDrive, pass your OneDrive's drive ID (the Drive ID get_drive_item shows for one of your files) | |
| destination_folder_id | Yes | ID of the folder to copy it into, or "root" for the top of the drive |