# get_panel_recommendation

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

The CodePanel MCP tool that previews the reviewers and orchestrator for a cost and quality goal, with estimated cost. It changes nothing.

`get_panel_recommendation` previews the panel CodePanel would build for a goal, such as `cost: "low"` and `quality: "high"`, with the model, estimated cost and reason for every seat. It changes nothing. Call it before `apply_panel` to see what would change and what a round and a pull request would cost. It needs only the `read` scope.

## When to call it

- **Before you apply a panel.** `unchanged` and `nextAction` say whether `apply_panel` with the same arguments would change anything.
- **To price a setup.** `estimate` gives dollars per round and per pull request, and `comparison` sets that against the panel as it is now.
- **To check a limit.** With `maxUsdPerPr`, `budget` says whether the plan fits and which cuts were needed.

`apply_panel` takes the same inputs and writes the result. This tool has no side effects, so you can call it as often as you like and compare goals.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `cost` | `low` or `medium` or `high` | no | How much to spend: picks the model tiers. Default medium |
| `quality` | `low` or `medium` or `high` | no | How thorough: picks the roles and effort. Default medium |
| `repo` | string | no | Set up this repository alone, priced from its own recent rounds |
| `panelId` | string | no | Without repo: the panel to change; default panel if left out |
| `roles` | array of strings | no | Role ids from list_roles, instead of the goal's |
| `provider` | string | no | Keep every seat on this provider |
| `maxUsdPerPr` | number | no | Spend at most this per pull request; apply also sets it as the panel's limit |

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

`cost` picks the model tiers and `quality` picks the roles and reasoning effort. Each defaults to `medium`. [Ask for a panel by goal](/docs/reviewers#ask-for-a-panel-by-goal) has the table of what each level does.

- **What is priced against what.** With `repo`, the estimate uses that repository's own recent rounds, up to the last 30, and the recommendation targets that repository's own panel. Without it, the estimate uses typical call sizes and the target is `panelId`, or your default panel.
- **Existing seats stay.** Without `roles`, the recommendation keeps the target panel's current reviewers and their roles, and the goal changes their models and effort. Pass `roles` (ids from [`list_roles`](/docs/mcp-server/list_roles)) to choose a different lineup.
- **`provider`** keeps every seat on one provider. **`maxUsdPerPr`** cuts tiers and roles until the estimate fits, and it is a positive amount in dollars.

Errors a caller can hit:

| Message | Cause |
| --- | --- |
| `Pass repo or panelId, not both.` | Both were given |
| `unknown role <id>; roles must be role ids from GET /roles: <ids>` | A `roles` entry that `list_roles` does not return |
| `maxUsdPerPr must be a positive number` | A zero or negative limit. The tool's schema usually rejects it first |
| `No working API key for <provider>. Add one in Settings first.` | `provider` names one with no key and no credits |
| `None of your providers reports a model that can review code.` | No key reaches a model for a tier |
| `Panel not found` | An unknown `panelId`, or one that is not yours |

## What it returns

- `goal`, `repo` and `target`. `target.scope` is `repo`, `default` or `panel`, and `target.panelId` is `null` when applying would give the repository its own panel. `target.note` says which panels apply would and would not touch.
- `reviewers` and `orchestrator`: each seat with `tier`, `provider`, `modelId`, a readable `model`, `reasoningEffort`, `source` (`own_key`, or `credits` when no key of yours reaches the tier), `usdPerRound` (`null` for a model with no price) and `reason`. A reviewer also has its `role`, and `agentId` when it matches an existing seat.
- `estimate`: `usdPerRound`, `usdPerPr`, `roundsPerPr` and the token sizes behind them. `basis` is `repo_history` or `typical`, and `sampleRounds` is how many rounds the history held. Prices are list prices without prompt-cache discounts, and only successful calls count. A model with no price is named in `unpriced` and left out of the totals.
- `comparison`: the panel's current cost a round and `estimatedReductionUsdPerPr`, positive when the recommendation is cheaper. Either is `null` when a model on either side is unpriced.
- `budget`: `maxUsdPerPr`, `fits` and the `changes` made to fit. `fits` is `null`, and nothing is cut, when a seat has no price.
- `current`: the target panel's seats now.
- `changes`: one line per seat saying what applying would do to it.
- `unchanged` and `nextAction`: `apply`, or `none` when the target panel already runs this setup.

The `reason` on a seat says what CodePanel measured for that choice, or that it has not measured it. Treat the dollar figures as estimates, not a quote: the sample below is a seed-data run.

## Examples

These responses come from a test account on a local backend. Model ids and prices are seed values, not real prices.

### Preview a low-cost, high-quality panel for one repository

```json title="Call"
{
  "repo": "codepanel-dev/web-app",
  "cost": "low",
  "quality": "high"
}
```

The real result is about 6 KB. This copy keeps the first of four reviewers in `changes`, `reviewers` and `current`, cuts each `reason` and the `estimate.note` after their first sentence, and marks each cut with an ellipsis.

```json title="Result (trimmed)"
{
  "budget": {
    "changes": [],
    "fits": null,
    "maxUsdPerPr": null
  },
  "changes": [
    "Retain Bugs & Security (k57f28zq4gs6631q0x3yrpb54s8j704w): keep its instructions and history; use anthropic/claude-haiku-5-5 at high effort."
  ],
  "comparison": {
    "currentUsdPerRound": 0.212525,
    "estimatedReductionUsdPerPr": 0.22649249999999999,
    "note": "Both configurations priced on the same token profile. Estimates exclude subscription fees, prompt-cache effects and quality-related changes in review volume. Positive reduction is estimated savings; negative is extra cost."
  },
  "current": {
    "orchestrator": {
      "agentId": "k5775rqpcnqr3m3mz31d47xr5h8j7kcm",
      "modelId": "claude-opus-5-5",
      "name": "Orchestrator",
      "provider": "anthropic",
      "reasoningEffort": "medium"
    },
    "reviewers": [
      {
        "agentId": "k57f28zq4gs6631q0x3yrpb54s8j704w",
        "modelId": "claude-sonnet-5-5",
        "name": "Bugs & Security",
        "provider": "anthropic",
        "reasoningEffort": "medium"
      }
    ]
  },
  "estimate": {
    "basis": "repo_history",
    "note": "Medians of this repository's last 5 rounds. …",
    "orchestratorInputTokens": 14000,
    "orchestratorOutputTokens": 1600,
    "reviewerInputTokens": 23750,
    "reviewerOutputTokens": 1200,
    "roundsPerPr": 1.3,
    "sampleRounds": 5,
    "unpriced": [],
    "usdPerPr": 0.04979,
    "usdPerRound": 0.0383
  },
  "goal": {
    "cost": "low",
    "quality": "high"
  },
  "nextAction": "apply",
  "orchestrator": {
    "model": "Sonnet 5.5",
    "modelId": "claude-sonnet-5-5",
    "provider": "anthropic",
    "reason": "Balanced orchestrator: …",
    "reasoningEffort": "high",
    "source": "own_key",
    "tier": "balanced",
    "usdPerRound": 0.026399999999999996
  },
  "repo": "codepanel-dev/web-app",
  "reviewers": [
    {
      "agentId": "k57f28zq4gs6631q0x3yrpb54s8j704w",
      "model": "Haiku 5.5",
      "modelId": "claude-haiku-5-5",
      "name": "Bugs & Security",
      "provider": "anthropic",
      "reason": "Kept this existing seat, its instructions and history. …",
      "reasoningEffort": "high",
      "role": "bugs-security",
      "source": "own_key",
      "tier": "economy",
      "usdPerRound": 0.002975
    }
  ],
  "target": {
    "note": "Applying gives codepanel-dev/web-app its own panel; your default panel and other repositories are not changed.",
    "panelId": null,
    "scope": "repo"
  },
  "unchanged": false
}
```

Three things to read in it:

- `target.panelId` is `null` and `scope` is `repo`: this repository has no panel of its own yet, so applying would create one and leave the default panel alone.
- `sampleRounds` is 5, so `estimate` rests on five rounds of this repository, not the 30 it can use. `roundsPerPr` of 1.3 comes from the same history.
- `cost: "low"` put every reviewer on the economy tier, and `quality: "high"` raised their effort. The orchestrator stays on the balanced tier.

## The same step without MCP

| Surface | Form |
| --- | --- |
| CLI | `codepanel panel recommend --cost low --quality high --repo owner/name`, with `--panel`, `--roles a,b`, `--provider` and `--max-usd-per-pr` ([CLI](/docs/cli#panels-models-and-keys)) |
| HTTP API | [`GET /panels/recommend`](/docs/api#get-panelsrecommend), with `roles` as one comma-separated string |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Recommend reviewers and an orchestrator for a goal, e.g. cost "low", quality "medium". Changes nothing. Each seat has its role, provider, model, effort, source (own_key or credits), usdPerRound and a reason citing what CodePanel measured. estimate has usdPerRound and usdPerPr with its basis (repo_history from the repository's recent rounds, or typical). budget says whether it fits maxUsdPerPr and what was cut to fit. target says which panel apply_panel would change; current is that panel now; unchanged and nextAction (apply or none) say whether applying would change anything.

## Related

- [`apply_panel`](/docs/mcp-server/apply_panel): writes this recommendation and returns an `undo`.
- [`restore_panel`](/docs/mcp-server/restore_panel): puts the panel back.
- [`list_models`](/docs/mcp-server/list_models) and [`list_roles`](/docs/mcp-server/list_roles): the models and roles it chooses from.
- [Ask for a panel by goal](/docs/reviewers#ask-for-a-panel-by-goal): what each cost and quality level does.
- [MCP server](/docs/mcp-server#control-cost-and-check-quality): where it fits in tuning cost.
