file_version_restore
Restore a file to a saved version by replacing its current content with the selected version ID. The overwritten content is saved as a new version when overwrite protection is enabled.
Instructions
Replace a file's content with one of its versions (version_id from file_versions). Needs edit rights (files.modify); the content it replaces is kept as a version first. A file an app has locked answers LOCKED.
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": {
"path": "<path>",
"version_id": "<version_id>"
},
"name": "file_version_restore"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | adapter:// path of the file | |
| version_id | Yes | the version to bring back (an id file_versions answers) | |
| snapshot_current | No | keep the current content as a version first (the server already does this when its overwrite guard is on, the default) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | the operation's JSON answer - the body its REST twin under /api/ai answers (an object) | |
| status | Yes |