# retry_task

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

The CodePanel MCP tool that queues a failed or stopped agent app task again and wakes the local runner to claim it.

`retry_task` queues a failed or stopped task again, so a runner claims it as its next attempt, and takes its earlier runs out of your inbox. A runner on this machine is woken to claim it at once. It needs the `tasks:write` scope.

## When to call it

- **After a budget stop**, once the agent's budget is raised.
- **After a run that failed for a reason now fixed**, such as a flaky check or a missing key.

To change the prompt, start a new task with [`start_task`](/docs/mcp-server/start_task) instead.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `taskId` | string | yes | Id of a task, from list_tasks or start_task |
| `host` | `local` or `cloud` | no | Optional host override to hand off the retry between local and cloud |

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.

`taskId`, from [`list_tasks`](/docs/mcp-server/list_tasks) or a [`get_inbox`](/docs/mcp-server/get_inbox) item's targets.

## What it returns

`{ before, after }`, each the task as `list_tasks` shows it with `detail`; `after.status` is `queued`. A task already queued is left as it is, so the same call again changes nothing. A cancelled or succeeded task, one with a run in progress, or one at its run limit is refused. Undo with [`cancel_task`](/docs/mcp-server/cancel_task).

## The same step without MCP

| Surface | Form |
| --- | --- |
| HTTP API | `POST /tasks/retry` with the `tasks:write` scope |
| CLI | `codepanel task retry <taskId>` |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Use it to run a failed or stopped task again, such as a get_inbox budget_stop or owner_end item once its cause is fixed (raise the agent's budget, or sharpen the prompt by starting a new task instead). Pass optional host (local or cloud) to hand off the retry between your local runner and CodePanel Cloud. Queues the task again, so a runner claims it as its next attempt, and its earlier runs leave the inbox. A task already queued is left as it is, so the same call again changes nothing; a cancelled or succeeded task, one with a run in progress or one at its run limit is refused. Undo with cancel_task. Needs tasks:write. Returns { before, after }, each as list_tasks shows the task with detail.

## Related

- [`get_task`](/docs/mcp-server/get_task): the new attempt's run id.
- [`dismiss_inbox_item`](/docs/mcp-server/dismiss_inbox_item): leave the task as it is and clear its item.
- [MCP server](/docs/mcp-server): install, sign-in and every other tool.
