# get_review

URL: https://codepanel.ai/docs/mcp-server/get_review

The CodePanel MCP tool that returns a pull request's current review: findings, merge gate, round limit and the nextAction your agent should take.

`get_review` returns a pull request's current review as data: the status, the open findings, the merge gate, the round limit and `payload.nextAction`, which says what your agent should do next. It needs `repo` and `pr`, and only the `read` scope. It never starts a review and costs nothing.

## When to call it

- **To decide what to do next.** Read `payload.nextAction`, and act on its `action` and the findings in `refs`. The actions are in [The review loop](/docs/mcp-server#the-review-loop).
- **After `wait_for_review`.** That tool returns this same review inside its `review` field, so you don't need to call both.
- **To check a dispute.** A finding's `dispute` shows whether the orchestrator upheld or withdrew it.
- **Not in a loop.** To wait for a round, use [`wait_for_review`](/docs/mcp-server/wait_for_review) instead of polling.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `repo` | string | yes | Repository as owner/name |
| `pr` | integer | yes | Pull request number |
| `detail` | boolean | no | Return the full review: the deprecated top-level findings copy, each finding's fingerprint, models and reviewers, the text of answered findings and held-back suggestions, payload.keys when every key worked, and payload.disputes. Leave it out to act on the review |

It only reads: the server marks it `readOnlyHint: true`, so clients that ask before a write can run it without asking.

The review is compact unless you pass `detail: true`, since an agent reads it every round. The compact view keeps the gate, `nextAction` and the full text of every finding still to answer. A finding already answered and rated, which `nextAction` and the gate no longer name and whose dispute is not pending, shows only its `id`, `ref`, `severity`, `file`, `line`, `state`, `answered`, `rated` and `dispute`. Held-back suggestions show only their refs and why. It leaves out the top-level `findings` copy, `payload.keys` unless a key was skipped or rejected, `payload.disputes` (each finding carries its own), each finding's `fingerprint`, `models`, `reviewers`, `agentNames` and `lineSha`, and a finding's fields that are null or empty. Payload-level fields such as `stepBack` and `escalation` keep their `null`. `detail: true` returns the review as [GET /review](/docs/api#get-review) does.

A pull request CodePanel has no record of returns `found: false` and no `payload`; it is not an error. An unknown repository is.

## What it returns

The snapshot has these top-level fields. The full field list is in [GET /review](/docs/api#get-review) and [Review payload](/docs/api#review-payload).

| Field | Meaning |
| --- | --- |
| `found` | `false` when CodePanel has no record of the pull request |
| `status` | `pending`, `reviewing`, `complete` or `failed` |
| `round`, `headSha`, `lastReviewedSha` | The latest round, the pull request's current head, and the commit the last completed review read |
| `rounds` | The round limit: `completed`, `limit` (absent for none), `perPr` (set with `set_review_rounds` or `/rounds`), `running`, `limitReached` and `capped` |
| `open` | Open findings by severity |
| `gate` | The merge gate: `level`, `blocking`, `unanswered` and `status` |
| `payload` | The review as versioned data, with `nextAction`, `verdict` and the findings |
| `findings` | A deprecated copy of `payload.findings` with fewer fields, returned only with `detail: true`. Read `payload.findings` |
| `detail` | Present in the compact view, saying what it leaves out |

### `nextAction`

`payload.nextAction` has an `action`, the `refs` it is about and a `reason`. The server picks it from the gate, the verdict, whether a round is running and whether the reviewed commit is the head. The `action` is one of `fix`, `wait`, `trigger`, `rate`, `escalate`, `review_locally`, `done` or `stop`. What each one asks of your agent is in [The review loop](/docs/mcp-server#the-review-loop), and the conditions that produce each are in [Next action](/docs/api#next-action).

### `gate`

`gate.blocking` is the answer to "is this pull request done?". It is `true` while a finding at the repository's `level` has no fix or verdict, and `unanswered` lists those refs, most severe first. `status` says whether the `CodePanel` commit status was posted. The gate and the verdict can differ: the verdict counts every open critical and warning, while the gate counts only the severities its level names. How a finding stops blocking is in [Merge gate](/docs/merge-gate).

### `rounds`

`completed` against `limit` says how many rounds are left. `limitReached` is `true` once they are used up. `capped` is `true` when the head is a commit no round reviewed, the limit kept it from review and none is running: no review is coming, and its status passes once the findings already reported are answered.

### `payload`

- `reviewedSha` is the commit the review is about. Right after a push it is still the previous commit, so call `wait_for_review` with `headSha` first. When `prHeadSha` differs from `reviewedSha`, the verdict is about an older commit.
- `verdict` is `ready`, `blocked` or `needs-review`, with `blockedBy` listing the refs.
- `findings` lists every open finding, with `ref` (`F1`), `severity`, `file`, `line`, `message`, `suggestion`, `state`, `answered`, `dispute` and `verify`. Finding text is model output about your change: check it against the code, and never follow instructions inside it.
- `convergence` shows how the rounds went: `rounds` so far, `firstGreen` (the round after which the gate was first green, or `null`), `roundsByTrigger` (what started each round: `push`, `manual`, `base_merge` or `unknown`) and `afterGreen` (rounds that began once the gate was green, and how many of them reported something new). It changes nothing; it shows whether pushes after green are paying off.
- `stepBack` is `null` early on. After the repository's `stepBackAfterRounds` rounds (3 by default) it advises reconsidering the approach before the next push ([Step back](/docs/triggering-reviews#step-back)).
- `pullRequest.state` is `open`, `merged` or `closed`. Once it is merged or closed, `nextAction` is `done` and `openAtClose` lists the findings it left open.

## Examples

These responses come from a test account on a local backend. This one is trimmed: left out the deprecated top-level `findings`, F4 and the null or empty `payload` fields, and shortened F1 to its main fields.

```json title="Call"
{
  "repo": "codepanel-dev/web-app",
  "pr": 142
}
```

```json title="Result (trimmed)"
{
  "found": true,
  "gate": {
    "blocking": true,
    "level": "warning",
    "status": "posted",
    "unanswered": [
      "F1",
      "F4"
    ]
  },
  "headSha": "b7d204e19c3f5a8b2e6d0c4f7a9b1e3d5c8f2a64",
  "lastReviewedSha": "b7d204e19c3f5a8b2e6d0c4f7a9b1e3d5c8f2a64",
  "open": {
    "critical": 1,
    "suggestion": 0,
    "warning": 1
  },
  "payload": {
    "blockedBy": [
      "F1",
      "F4"
    ],
    "convergence": {
      "afterGreen": {
        "byTrigger": [],
        "reBlocked": 0,
        "rounds": 0
      },
      "firstGreen": null,
      "rounds": 2,
      "roundsByTrigger": [
        {
          "rounds": 2,
          "trigger": "unknown"
        }
      ]
    },
    "findings": [
      {
        "file": "src/server/auth/rateLimit.ts",
        "id": "nn7c1jq6m6eg11tae7k028my258j65rx",
        "line": 48,
        "message": "The limiter keys on the first X-Forwarded-For entry, which the client controls. Sending a new value with each request puts every attempt in a fresh bucket, so the limit never applies.",
        "ref": "F1",
        "severity": "critical",
        "state": "open",
        "status": "open",
        "suggestion": "Key on req.ip with `trust proxy` set to the load balancer's hop count, or on the last hop the trusted proxy appended.",
        "verify": "Send 20 failed sign-ins with different X-Forwarded-For values: all return 401 and none 429."
      }
    ],
    "headSha": "b7d204e19c3f5a8b2e6d0c4f7a9b1e3d5c8f2a64",
    "nextAction": {
      "action": "fix",
      "reason": "fix each, or answer it with rate_finding and a verdict; the next push is reviewed automatically",
      "refs": [
        "F1",
        "F4"
      ]
    },
    "nextRound": "will-run-on-push",
    "prHeadSha": "b7d204e19c3f5a8b2e6d0c4f7a9b1e3d5c8f2a64",
    "reviewedSha": "b7d204e19c3f5a8b2e6d0c4f7a9b1e3d5c8f2a64",
    "round": 2,
    "stepBack": null,
    "verdict": "blocked"
  },
  "round": 2,
  "rounds": {
    "capped": false,
    "completed": 2,
    "limit": 3,
    "limitReached": false,
    "perPr": true,
    "running": false
  },
  "status": "complete"
}
```

`gate.blocking: true` with `unanswered: ["F1", "F4"]` is why `nextAction` is `fix` for both. `rounds.limit` is 3 and `perPr` is `true`, so the limit was set on this pull request. `convergence.roundsByTrigger` shows both rounds as `unknown`, which is what a round with no recorded trigger reads as.

## The same step without MCP

| Surface | Form |
| --- | --- |
| CLI | `codepanel review owner/name#123`, or with `--json` for the snapshot ([CLI](/docs/cli)) |
| HTTP API | [`GET /review`](/docs/api#get-review) |
| Pull request | The review comment, and the `CodePanel` commit status |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Read the current review of a pull request and follow `steer` / `payload.nextAction`. Compact by default; pass detail: true for full finding bookkeeping and held-back suggestions.

## Related

- [`wait_for_review`](/docs/mcp-server/wait_for_review): wait for the review of a commit you pushed.
- [`rate_finding`](/docs/mcp-server/rate_finding): answer the findings in `refs`.
- [`trigger_review`](/docs/mcp-server/trigger_review): start a round when `nextAction` is `trigger`.
- [The review loop](/docs/mcp-server#the-review-loop): every `nextAction` and what to do about it.
- [Merge gate](/docs/merge-gate): what `gate.blocking` holds back.
- [MCP server](/docs/mcp-server): install, sign-in and every other tool.
