# take\_review\_snapshot

Take a snapshot of a task's checkout to review, the caller's task by default.

writes · idempotent · MCP tool · [Agent](https://komrad.dev/latest/api/agent.md)

Diff the snapshot's `base_sha` against its `sha` to read the change. A checkout that hasn't changed since the newest snapshot returns that snapshot.

## Calling it

```bash
curl -X POST http://127.0.0.1:8787/komrad.agent.v1.AgentService/TakeReviewSnapshot \
  -H 'Content-Type: application/json' \
  -d '{}'
```

```bash
komrad rpc take-review-snapshot
```

```json
{
  "name": "take_review_snapshot",
  "arguments": {}
}
```

Offered by the komrad MCP server to reviewer agents.

## Request

### TakeReviewSnapshotRequest

TakeReviewSnapshotRequest saves a task's worktree as its next snapshot. When the worktree has not changed since the newest snapshot, the call returns that snapshot.

| Field | Type | Description |
| --- | --- | --- |
| [one of](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-TakeReviewSnapshotRequest-task) |  | The task whose worktree to save. Unset uses the caller's own task. |
| [`task_id`](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-TakeReviewSnapshotRequest-task_id) | uuid | The task, by id. |
| [`task_slug`](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-TakeReviewSnapshotRequest-task_slug) | string not empty | The task, by slug. |

## Response

### TakeReviewSnapshotResponse

| Field | Type | Description |
| --- | --- | --- |
| [`snapshot`](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-TakeReviewSnapshotResponse-snapshot) | [ReviewSnapshot](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-ReviewSnapshot) | The snapshot to review. The newest existing snapshot when the worktree has not changed. |

## Types

### ReviewSnapshot

ReviewSnapshot is a snapshot of a task's worktree, saved as a commit, that a review is written against. A snapshot never changes.

| Field | Type | Description |
| --- | --- | --- |
| [`id`](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-ReviewSnapshot-id) | uuid\* | The snapshot's id. |
| [`task_id`](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-ReviewSnapshot-task_id) | uuid\* | The id of the task the snapshot was taken of. |
| [`ordinal`](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-ReviewSnapshot-ordinal) | int32 | The snapshot's number within its task, counting from one. |
| [`base_sha`](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-ReviewSnapshot-base_sha) | string | The commit on the base branch that the task's branch started from when the snapshot was taken. |
| [`sha`](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-ReviewSnapshot-sha) | string | The commit holding the whole worktree, tracked and untracked files alike. |
| [`created_at`](https://komrad.dev/latest/api/agent/take-review-snapshot.md#komrad-agent-v1-ReviewSnapshot-created_at) | timestamp | When the snapshot was taken. |
