# list_findings

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

The CodePanel MCP tool that lists a pull request's findings with refs, ids, state and answered status, without the rest of the review.

`list_findings` returns the findings on a pull request with their refs, ids, state and whether each one is answered, without the rest of the review. Call it when you need a finding's `id` for `dismiss_finding` or `reopen_finding`, or want to see what is still open without fetching the whole `get_review` payload. It only reads, and it needs the `read` scope.

## When to call it

- **To get a finding's `id`:** `dismiss_finding` and `reopen_finding` take either `ref` with `repo` and `pr`, or an `id`.
- **To check what is still unanswered:** `answered` and `rated` say whether a verdict or rating exists since the last round reported the finding.
- **To see closed ones:** pass `includeResolved: true` for resolved and dismissed findings too.

For what to do next (fix, wait, rate), use [`get_review`](/docs/mcp-server/get_review): its `nextAction` and `gate` decide that, and `list_findings` does not.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `repo` | string | yes | Repository as owner/name |
| `pr` | integer | yes | Pull request number |
| `includeResolved` | boolean | no |  |

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

`pr` is the pull request number. For a pull request CodePanel has no review for, the answer is `{ "found": false, "findings": [] }`.

## What it returns

`found`, and `findings` in the same shape as `payload.findings` in `get_review`. Empty values are `null`, never left out. Each finding has:

- `id` and `ref`: follow a finding across rounds by these (`F3`).
- `severity`, `file`, `line`, `message` and `suggestion`.
- `state`: `new`, `open`, `resolved` or `dismissed`. The last two appear only with `includeResolved`.
- `answered`, `rated` and `dispute`: the gate's view, and an agent's dispute with its `status` (`pending`, `withdrawn`, `upheld`, `revised` or `closed`).
- `dismissReason`: why a dismissed finding was closed, else `null`.
- `firstSeenRound`, `lastSeenRound`, `reviewers`, `source` and `instances` (other places with the same defect).

`status`, `dismissed` and `agentNames` are deprecated duplicates of `state` and `reviewers`.

## Examples

These responses come from a test account on a local backend. The findings are seed data.

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

```json title="Result"
{
  "findings": [
    {
      "agentNames": ["Bugs & Security", "Docs & Best Practices"],
      "answered": false,
      "dismissReason": null,
      "dismissed": false,
      "dispute": null,
      "file": "src/server/auth/rateLimit.ts",
      "firstSeenRound": 1,
      "id": "nn7c1jq6m6eg11tae7k028my258j65rx",
      "instances": [],
      "lastSeenRound": 2,
      "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.",
      "rated": false,
      "ref": "F1",
      "reviewers": ["Bugs & Security", "Docs & Best Practices"],
      "severity": "critical",
      "source": "reviewers",
      "state": "open",
      "status": "persisting",
      "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."
    },
    {
      "agentNames": ["Docs & Best Practices", "Design & UX"],
      "answered": false,
      "dismissReason": null,
      "dismissed": false,
      "dispute": null,
      "file": "src/server/auth/rateLimit.ts",
      "firstSeenRound": 2,
      "id": "nn7bmyaaa5572n7cwez665991d8j71de",
      "instances": [],
      "lastSeenRound": 2,
      "line": 63,
      "message": "INCR and EXPIRE run as two commands. If the process dies between them the key never expires, and that address stays locked out until someone deletes it.",
      "rated": false,
      "ref": "F4",
      "reviewers": ["Docs & Best Practices", "Design & UX"],
      "severity": "warning",
      "source": "reviewers",
      "state": "new",
      "status": "new",
      "suggestion": "Run both in one MULTI block, or SET the key with EX and NX before the INCR."
    }
  ],
  "found": true
}
```

Both findings are unanswered and unrated. F4's `id` is the one `dismiss_finding` and `reopen_finding` would take in place of `repo`, `pr` and `ref`. The arrays are written on one line here; the values are as returned.

## The same step without MCP

| Surface | Form |
| --- | --- |
| CLI | `codepanel findings owner/name#123`, with `--all` for resolved and dismissed ones ([CLI](/docs/cli)) |
| HTTP API | [`GET /findings`](/docs/api#get-findings) with `repo`, `pr` and `includeResolved` |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Findings on a pull request in the shape of get_review's payload.findings (id, ref like F3, state new|open|resolved|dismissed, answered, rated, dispute). Resolved and dismissed ones only if includeResolved.

## Related

- [`get_review`](/docs/mcp-server/get_review): the verdict, the gate and `nextAction`.
- [`dismiss_finding`](/docs/mcp-server/dismiss_finding) and [`reopen_finding`](/docs/mcp-server/reopen_finding): act on a finding by its `id`.
- [`rate_finding`](/docs/mcp-server/rate_finding): answer a finding.
- [Findings](/docs/findings#refs-and-statuses): refs, states and tracking across rounds.
- [MCP server](/docs/mcp-server): install, sign-in and every other tool.
