snippet_revisions
Read, retrieve, or restore earlier versions of a snippet's code, so an overwritten snippet is recoverable. Check existing code first, then roll back to any recorded revision.
Instructions
Read or roll back the history of a snippet. Every save that CHANGES the code writes a revision of what was there before, by agent or human alike — so an overwrite is recoverable. Actions: list (revision ids, timestamps, who, and the length of each — not the code), get (the full code of one revision, by revision_id), restore (put a revision back, by revision_id). A restore goes through the normal save path, so it is linted, front-end checked, and itself recorded as a revision — you can always walk back out. Use this BEFORE re-writing a snippet you did not author in this session: read what is there rather than assuming your version is still live.
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": {
"id": "<id>"
},
"name": "snippet_revisions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The snippet id. | |
| limit | No | How many revisions to list. Default 20, max 200. | |
| action | No | list | |
| revision_id | No | Required for get and restore. Comes from action=list. |