# submit_local_review

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

The CodePanel MCP tool that records what your own pre-push review found, stored against a commit as your claim. The gate and reviewers never read it.

`submit_local_review` stores what your agent found when it reviewed its own change with the brief from [`get_review_brief`](/docs/mcp-server/get_review_brief). It is saved against the commit you name, as your claim. It is free, starts no review and counts toward no plan. It needs `repo`, `headSha` and `findings`, and the `reviews:write` scope.

## When to call it

- **When `nextAction` is `review_locally`.** CodePanel refused to review the head, and this call is what moves `nextAction` on to the open findings. After it, `nextAction` follows them as if a round had run.
- **After a local review at any other time.** It is optional then. The local review shows on the pull request next to the real one.
- **Not to pass the gate.** The merge gate and the panel's reviewers never read it.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `repo` | string | yes | Repository as owner/name |
| `headSha` | string | yes | The full sha of the commit you reviewed (git rev-parse HEAD) |
| `pr` | integer | no | The pull request, when it is open |
| `verdict` | `ready` or `not-ready` | no | Your own call: ready to push, or not yet |
| `findings` | array of objects, at most 200 | yes |  |
| `findings[].file` | string | yes | Repository-relative path |
| `findings[].line` | integer | no |  |
| `findings[].severity` | `critical` or `warning` or `suggestion` | yes |  |
| `findings[].message` | string | yes | The problem, one line; kept to 500 characters |
| `findings[].fixed` | boolean | yes | Whether you fixed it before pushing |
| `agent` | string | no | Your name, e.g. claude-code. Defaults to this MCP client's name |

It writes: the server marks it `readOnlyHint: false` and `destructiveHint: true` (it can change what is already there), so a client that asks before writes asks here.

`headSha` is the full 40-character sha of the commit you reviewed (`git rev-parse HEAD`). A short sha doesn't match. Send `pr` when the pull request is open, so `atHead` can tell you whether that commit is its head.

Each finding needs `file`, `severity` (`critical`, `warning` or `suggestion`), `message` and `fixed`. Say `fixed: true` for what you fixed before pushing. More than 200 findings are refused, and only the 50 most severe are kept. A message is put on one line, has hidden text taken out and is cut to 500 characters with a ` [cut]` mark.

## What it returns

| Field | Meaning |
| --- | --- |
| `ok` | `true` |
| `headSha` | The commit it was stored against |
| `atHead` | Whether that commit is the pull request's head, as CodePanel last saw it. Often `false`, since you review before you push |
| `counts` | Findings kept, by severity |
| `total`, `fixed` | How many were kept, and how many of them you marked fixed |
| `dropped` | Findings past the 50 kept |
| `edited` | Findings whose message was cleaned or cut |
| `shownOn` | Where it appears |

It shows as `payload.localReview` in [`get_review`](/docs/mcp-server/get_review) (counts and how many you fixed) and as one line on that commit's review comment, both marked as your claim, not checked by CodePanel. Submitting again for the same commit replaces it. A repository keeps the local reviews of its 200 most recently submitted commits.

## Examples

These responses come from a test account on a local backend.

```json title="Call"
{
  "repo": "codepanel-dev/web-app",
  "pr": 142,
  "headSha": "b7d204e19c3f5a8b2e6d0c4f7a9b1e3d5c8f2a64",
  "verdict": "ready",
  "findings": [
    {
      "file": "src/server/auth/rateLimit.ts",
      "line": 48,
      "severity": "critical",
      "message": "Limiter keyed on client-supplied X-Forwarded-For",
      "fixed": true
    },
    {
      "file": "src/server/auth/rateLimit.ts",
      "line": 63,
      "severity": "suggestion",
      "message": "Window constant could move to config/auth.ts",
      "fixed": false
    }
  ],
  "agent": "claude-code"
}
```

```json title="Result"
{
  "ok": true,
  "atHead": true,
  "counts": {
    "critical": 1,
    "suggestion": 1,
    "warning": 0
  },
  "dropped": 0,
  "edited": 0,
  "fixed": 1,
  "headSha": "b7d204e19c3f5a8b2e6d0c4f7a9b1e3d5c8f2a64",
  "total": 2,
  "shownOn": "payload.localReview and one line on the review comment of that commit, as your claim; the gate and the reviewers never read it"
}
```

Two findings were sent and both were kept. `fixed: 1` counts the critical that the call marked fixed, and the suggestion was left open.

## The same step without MCP

| Surface | Form |
| --- | --- |
| CLI | `codepanel review --local --submit <file\|->`, with the JSON `{"verdict", "findings"}` or the findings array alone, against `HEAD` or `--sha` ([CLI](/docs/cli)) |
| HTTP API | [`POST /reviews/local`](/docs/api#post-reviewslocal) |

## What the server tells your agent

The description your agent reads when it lists the tools:

> After you ran get_review_brief's text: send what it found, stored against the commit you name. When CodePanel refused to review a head (nextAction review_locally), this is the step that lets nextAction move on; otherwise it is optional. The review payload shows it as localReview (counts and how many you fixed) and the review comment of that commit shows one line, both marked as your claim, not checked by CodePanel. The gate and the panel's reviewers never read it, and it starts no review and counts toward no plan. Messages are kept to 500 characters, and the 50 most severe findings are kept. Submitting again for the same commit replaces it.

## Related

- [`get_review_brief`](/docs/mcp-server/get_review_brief): the brief you run first.
- [`get_review`](/docs/mcp-server/get_review): shows `payload.localReview` and the `nextAction` that follows.
- [`wait_for_review`](/docs/mcp-server/wait_for_review): its `refused` status is when to send this.
- [When CodePanel won't review a commit](/docs/mcp-server#when-codepanel-wont-review-a-commit): the whole route.
- [MCP server](/docs/mcp-server): install, sign-in and every other tool.
