Delete a deck
delete_deckDelete an AnkiWeb deck with its subdecks and every card, permanently across synced devices. Preview the removal first, then confirm to delete by deck id; nothing is removed without confirmation.
Instructions
Delete one of the signed-in user's decks, with its subdecks and every card in them, from their AnkiWeb collection. The deletion reaches every device on its next sync and cannot be undone.
Without confirm, nothing is deleted: the call finds the deck and returns a preview of what goes. Show that preview to the user and wait for their explicit go-ahead before calling again with confirm: true.
The confirmed call must name the deck by its numeric id, as the preview gives it, never by name.
With more than one AnkiWeb account stored, the preview names the one the deck belongs to, and the confirmed call must name it in account.
Needs an AnkiWeb session.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"deck": "<deck>"
},
"name": "delete_deck"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deck | Yes | The deck's id or its exact full name, as list_my_decks gives them. A confirmed call takes the id only. | |
| account | No | Omit unless the user names an AnkiWeb account. Which of the accounts signed in on this machine to act as; a name that is not one is refused with the list. | |
| confirm | No | true deletes. Only after the user has seen the preview and agreed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deck | Yes | ||
| status | Yes | ||
| account | No | The account the deck belongs to, given when more than one is stored. | |
| listings | Yes | Shared listings of the deck or its subdecks. They stay on AnkiWeb after the deck is deleted; unshare_deck removes them. | |
| subdecks | Yes | Deleted along with the deck. |