# history

> History, undo and redo. Change log (action=list, newest first, with actor; actor, cursor, limit: list only); undo/redo your own latest step (one per call); revert to a revision or checkpoint as a new step (dry_run previews); diff two revisions; checkpoints, checkpoint, rename_checkpoint, remove_checkpoint name revisions.

Source: https://stuarty.com/docs/mcp/tools/history/

Change log (action=list, newest first, with actor; actor, cursor, limit: list only); undo/redo your own latest step (one per call); revert to a revision or checkpoint as a new step (dry_run previews); diff two revisions; checkpoints, checkpoint, rename_checkpoint, remove_checkpoint name revisions. Undo skips (and reports) others' later changes. domain=image (image_id): all but list.

## Behaviour

These are the annotations of the tool definition, the hints a client uses to decide whether to ask before a call. `history` is listed by `tools/list`.

| Property | Value |
| --- | --- |
| Read only | no |
| Destructive | no |
| Idempotent | no |
| Reaches outside the workspace | no |

## Input

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `domain` | `video`, `image` | no | default `"video"` |
| `image_id` | `string` | no | pattern `^img_[0-9a-hjkmnp-tv-z]{10}$` |
| `project_id` | `string` | no | pattern `^prj_[0-9a-hjkmnp-tv-z]{10}$` |
| `timeline_id` | `string` | no | pattern `^prj_[0-9a-hjkmnp-tv-z]{10}$` |
| `action` | `string`, one of 9 values | no | default `"list"` |
| `actor` | `string` | no |  |
| `cursor` | `string` | no |  |
| `limit` | `integer` | no | min 1; max 100; default `20` |
| `revision` | `integer` | no | min 1 |
| `until` | `integer` | no | min 1 |
| `name` | `string` | no |  |
| `new_name` | `string` | no |  |
| `note` | `string` | no |  |
| `dry_run` | `boolean` | no |  |

## Output

A result has a text block, written for the model, and structured content with these members.

| Member | Type | Always present | Notes |
| --- | --- | --- | --- |
| `revision` | `integer` | yes |  |
| `kind` | `undo`, `redo`, `revert` | no |  |
| `entries` | array of `object` | no |  |
| `skipped` | array of `object` | no |  |
| `next_cursor` | `string` or `null` | no |  |

## Errors

- [`E_VALIDATION`](/docs/reference/error-codes#e_validation)
- [`E_NOT_FOUND`](/docs/reference/error-codes#e_not_found)
- [`E_NOTHING_TO_UNDO`](/docs/reference/error-codes#e_nothing_to_undo)
- [`E_NOTHING_TO_REDO`](/docs/reference/error-codes#e_nothing_to_redo)

A call over HTTP without credentials fails with `E_UNAUTHORIZED`, and too many calls with `E_RATE_LIMITED`. Both are in the [error codes](/docs/reference/error-codes).

## Safety

- `undo` and `redo` act on your own latest step only. A change another actor made after yours is skipped and reported.
- Undo is itself a step and can be redone.

## Next steps

- [Connect a client](/docs/mcp/connect)
- [The MCP tools](/docs/mcp/tools)

**Ask the agent**

> Undo my last change.

**The call**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "history",
    "arguments": {
      "project_id": "prj_7k2m9x4q1b",
      "action": "undo"
    }
  }
}
```

**The result**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "…"
      }
    ],
    "structuredContent": {
      "project_id": "prj_7k2m9x4q1b",
      "revision": 14,
      "kind": "undo",
      "applied": true
    }
  }
}
```

The values are illustrative. The text block holds the same result written for the model; its wording is left out here.
