# delete_rule

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

The CodePanel MCP tool that deletes an autopilot rule; the tasks it started stay.

`delete_rule` removes an autopilot rule for good. It needs the `tasks:write` scope. The tasks it started stay.

## When to call it

- **When the owner no longer wants the rule.** To pause it instead, call [`update_rule`](/docs/mcp-server/update_rule) with `enabled: false`.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `ruleId` | string | yes | Id of a rule, from list_rules |

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

`{ rule }`, the rule as it was, so [`create_rule`](/docs/mcp-server/create_rule) with those values brings it back under a new id. A missing rule, a malformed id and another account's rule are all `Rule not found`.

## The same step without MCP

| Surface | Form |
| --- | --- |
| HTTP API | `POST /autopilot/rules/delete` with the `tasks:write` scope |
| CLI | `codepanel rules delete <ruleId>` |
| Desktop app | Autopilot, a rule's Edit, Delete |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Use it to remove a rule for good; to pause it, update_rule with enabled false instead. Tasks it started stay. Needs the tasks:write scope. Returns { rule } as it was, so create_rule with those values brings it back under a new id.

## Related

- [`list_rules`](/docs/mcp-server/list_rules): ids.
- [MCP server](/docs/mcp-server): install, sign-in and every other tool.
