Move a file
move_fileMove a Google Drive file or folder to a new folder or shared drive. Optionally keep existing parents to add the destination without removing the original location.
Instructions
Moves a file or folder into another folder (or shared drive) and returns id, name and the new parents. By default the file leaves all its current parents (a plain move); keep_existing_parents=true only adds the new parent — note that files in shared drives always have exactly one parent, so keeping old parents fails there. Moving between My Drive and a shared drive changes ownership rules and may be rejected by the drive's settings. The move costs one extra read (the current parents are fetched first).
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": {
"file_id": "<file_id>",
"new_parent_id": "<new_parent_id>"
},
"name": "move_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes | The file id — the long id from the Drive URL (drive.google.com/file/d/<fileId> or docs.google.com/.../d/<fileId>/edit) or from search_files/get_file output. Folders and shared-drive items are files too. | |
| new_parent_id | Yes | Destination folder or shared-drive id ('root' = My Drive top level). | |
| keep_existing_parents | No | Add the new parent without removing the old ones (My Drive only; default false = a real move). |