# update_plan_step

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

The CodePanel MCP tool that moves a plan step to in_progress, done, blocked or skipped, and asks for a reason or evidence when its rules require one.

`update_plan_step` moves one step of a saved plan to a new status, records the `evidence` that it is done, or edits the step's text. It is where a plan's rules apply: a step that is blocked, skipped, reopened or started out of order needs a `reason`, and a step with acceptance criteria needs `evidence` to be `done`. It needs the `reviews:write` scope, and it works only where the deployment has plan tracking turned on.

## When to call it

- **When you start a step:** `status: "in_progress"`.
- **When you finish it:** `status: "done"`, with `evidence` such as a pull request, a commit or a test run.
- **When something stops you:** `status: "blocked"` with a `reason`.
- **When a step stops being needed:** `status: "skipped"` with a `reason`.
- **To fix the wording** of `title`, `detail` or `acceptance`, with no status.

Follow `nextAction` from the last result and you will rarely need a `reason`: the reasons exist for the times you depart from it.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `planId` | string | yes | Plan id, from list_plans or create_plan |
| `step` | string | yes | Step ref, like S3 |
| `status` | `pending` or `in_progress` or `done` or `blocked` or `skipped` | no |  |
| `reason` | string | no | Why: required for blocked, skipped, reopening and out-of-order starts |
| `evidence` | string | no | What shows the step is done |
| `title` | string, at most 200 characters | no |  |
| `detail` | string | no |  |
| `acceptance` | string | no |  |
| `agent` | string | no | Your agent name, kept in the plan's history |

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.

`status` is `pending`, `in_progress`, `done`, `blocked` or `skipped`. The same status as now changes nothing. `evidence` alone, with no status, saves evidence on the step.

### When a reason is required

The rules don't stop you from departing from the plan. They stop you from doing it silently. Each of these fails without a `reason`, and with one it succeeds and the reason goes into the history:

| You do | Error without a `reason` |
| --- | --- |
| Mark a step `blocked` or `skipped` | `Marking S3 blocked needs a reason` |
| Reopen a `done` or `skipped` step | `Reopening S1, which is done, needs a reason` |
| Start a step while another is `in_progress` | `S1 is still in progress; starting S2 runs two at once: pass a reason to do it anyway, or follow the plan's nextAction` |
| Start, or finish without starting, a step ahead of an open earlier one | `S3 starts before S2, which is pending: pass a reason ...` (the same ending) |

The last two also write a `deviation` entry to the history, naming the step it went ahead of. A `done` that follows a normal start is not a second deviation.

### When evidence is required

If a step has `acceptance`, moving it to `done` needs `evidence` that meets it, unless the step already holds evidence:

```text
CodePanel: S1 has acceptance criteria: pass evidence (a pull request, commit or test run) that meets them
```

A step with no `acceptance` can be `done` without evidence. Pass it anyway when you have it. It stays on the step and in what [`get_plan`](/docs/mcp-server/get_plan) returns.

### Other refusals

- A step with an active sub-plan can only be set to `in_progress`. Anything else fails with `S2 has 1 active sub-plan(s): complete or abandon them first (block a step inside the sub-plan instead)`. See [`create_plan`](/docs/mcp-server/create_plan#sub-plans).
- An abandoned plan takes no step changes: `The plan is abandoned; set its status to active before changing it`.
- `step` must be a ref like `S3`; `Tracked plan step S9 not found` if no such step. `reason` is at most 2,000 characters, `evidence`, `detail` and `acceptance` at most 20,000, a `title` at most 200.

With plan tracking off on the deployment, the call fails with `CodePanel: Plan tracking is off on this deployment (PLAN_TRACKING)`.

## What it returns

The whole plan, as [`get_plan`](/docs/mcp-server/get_plan) returns it. The history gets a `step_status` entry with `from` and `to` (and the `reason`), or a `step_edited` entry for a text change. The plan completes by itself, with a `plan_status` entry, once every step is `done` or `skipped`. It returns to `active` if you reopen one. You never set `completed` yourself.

## Examples

These responses come from a test account on a local backend, trimmed to the first history entry and the first step.

Starting `S1` with `status: "in_progress"` needs no reason when it is the step `nextAction` named. `nextAction` then changes from `start` to `continue`.

### Done without evidence

`S1` has acceptance criteria, so this is refused and nothing changes:

```json title="Call"
{
  "planId": "xd7ffsskhwq6bg3ff59ptazsh98j7xjs",
  "step": "S1",
  "status": "done",
  "agent": "claude-code"
}
```

```text title="Result (tool error)"
CodePanel: S1 has acceptance criteria: pass evidence (a pull request, commit or test run) that meets them
```

### Done with evidence

```json title="Call"
{
  "planId": "xd7ffsskhwq6bg3ff59ptazsh98j7xjs",
  "step": "S1",
  "status": "done",
  "evidence": "rateLimit.test.ts: 10 spoofed requests, 11th refused (commit 3f2a9c1)",
  "agent": "claude-code"
}
```

```json title="Result (trimmed)"
{
  "createdAt": 1794614635238,
  "goal": "Make the login limit apply per client, not per X-Forwarded-For value",
  "history": [
    {
      "agent": "claude-code",
      "at": 1794614643860,
      "detail": null,
      "from": "in_progress",
      "id": "x57b6e0bt4sdk6k3m57pyeezah8j6hce",
      "kind": "step_status",
      "reason": null,
      "step": "S1",
      "to": "done"
    }
  ],
  "nextAction": {
    "action": "start",
    "planId": "xd7ffsskhwq6bg3ff59ptazsh98j7xjs",
    "reason": "it is the next pending step",
    "step": "S3",
    "steps": []
  },
  "parentPlanId": null,
  "parentStep": null,
  "planId": "xd7ffsskhwq6bg3ff59ptazsh98j7xjs",
  "progress": {
    "blocked": 0,
    "done": 1,
    "inProgress": 0,
    "pending": 2,
    "skipped": 0,
    "total": 3
  },
  "repo": "codepanel-dev/web-app",
  "status": "active",
  "steps": [
    {
      "acceptance": "A test sends ten requests with different X-Forwarded-For values and the eleventh is refused",
      "completedAt": 1794614643860,
      "detail": "src/server/auth/rateLimit.ts:48",
      "evidence": "rateLimit.test.ts: 10 spoofed requests, 11th refused (commit 3f2a9c1)",
      "reason": null,
      "ref": "S1",
      "status": "done",
      "subplans": [],
      "title": "Key the limiter on the trusted hop",
      "updatedAt": 1794614643860
    }
  ],
  "title": "Fix rate limiter bucket key",
  "updatedAt": 1794614643860
}
```

`S1` keeps its `evidence` and gets a `completedAt`. `nextAction` moves to `S3`, the next step in plan order.

### Blocked without a reason

```json title="Call"
{
  "planId": "xd7ffsskhwq6bg3ff59ptazsh98j7xjs",
  "step": "S3",
  "status": "blocked",
  "agent": "claude-code"
}
```

```text title="Result (tool error)"
CodePanel: Marking S3 blocked needs a reason
```

## The same step without MCP

| Surface | Form |
| --- | --- |
| CLI | `codepanel plan step <planId> S3 in_progress`, with `--reason`, `--evidence` and `--agent` ([CLI](/docs/cli#tracked-plans)) |
| HTTP API | [`POST /plans/step`](/docs/api#post-plansstep) with the same fields |

The CLI moves a step's status only. To edit its text, use MCP or the HTTP API.

## What the server tells your agent

The description your agent reads when it lists the tools:

> Move a step through the plan, or edit it. Rules that keep the plan honest: blocked and skipped need a reason; starting a step while another is in progress, or starting or finishing one before an earlier step that is still open, is a deviation and needs a reason (kept in the history); reopening a done or skipped step needs a reason; done needs evidence (a PR, commit or test run) when the step has acceptance criteria; a step with an active sub-plan keeps its status until the sub-plan closes (block a step inside it instead). The plan completes by itself once every step is done or skipped. Returns the plan: planId, status (active, completed, abandoned), progress, steps (ref like S3, status pending|in_progress|done|blocked|skipped, acceptance, evidence, reason, subplans), history (newest first, with deviations and reasons) and nextAction. Act on nextAction: start or continue its step (in its planId, which may be a sub-plan), unblock its steps, add_steps, or done.

## Related

- [`get_plan`](/docs/mcp-server/get_plan): how to read `nextAction`.
- [`add_plan_steps`](/docs/mcp-server/add_plan_steps): add what you found missing.
- [`update_plan`](/docs/mcp-server/update_plan): abandon or reactivate the whole plan.
- [Tracked plans](/docs/api#tracked-plans): the rules, in the HTTP API reference.
