# remove_coding_agent

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

The CodePanel MCP tool that removes a coding agent and returns it as it was, so create_coding_agent can bring it back.

`remove_coding_agent` deletes a coding agent. It needs the `agents:write` scope.

## When to call it

- **To retire an agent** nothing should use any more.
- **To undo** [`create_coding_agent`](/docs/mcp-server/create_coding_agent) or [`duplicate_coding_agent`](/docs/mcp-server/duplicate_coding_agent).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `agentId` | string | yes | Id of a coding agent, from list_coding_agents |

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.

## What it returns

`{ removed }`: the agent as [`list_coding_agents`](/docs/mcp-server/list_coding_agents) showed it just before. To bring it back, call [`create_coding_agent`](/docs/mcp-server/create_coding_agent) with those values; it gets a new id.

## The same step without MCP

| Surface | Form |
| --- | --- |
| HTTP API | `POST /autopilot/agents/remove` with the `agents:write` scope |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Use it to retire an agent no task should run on again. Needs the agents:write scope. Returns { removed }: the agent as it was, so create_coding_agent with those values brings it back (under a new id).

## Related

- [`list_coding_agents`](/docs/mcp-server/list_coding_agents): read the agents and their ids.
- [Scopes](/docs/mcp-server#scopes): what `agents:write` allows.
- [MCP server](/docs/mcp-server): install, sign-in and every other tool.
