deck_changeDeck
Move specified Anki flashcard IDs to a new or existing deck, simplifying deck organization and management directly through the MCP server.
Instructions
Moves cards with the given IDs to a different deck, creating the deck if it doesn't exist yet.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cards | Yes | A list of card IDs to move. | |
| deck | Yes | The target deck name. |
Implementation Reference
- src/anki_mcp/deck_service.py:68-76 (handler)The handler function for the deck_changeDeck tool. It takes a list of card IDs and a target deck name, then calls the AnkiConnect 'changeDeck' API to move the cards.@deck_mcp.tool( name="changeDeck", description="Moves cards with the given IDs to a different deck, creating the deck if it doesn't exist yet.", ) async def change_deck_tool( cards: Annotated[List[int], Field(description="A list of card IDs to move.")], deck: Annotated[str, Field(description="The target deck name.")], ) -> None: return await anki_call("changeDeck", cards=cards, deck=deck)
- src/anki_mcp/__init__.py:23-23 (registration)Registers the deck service tools (including changeDeck as deck_changeDeck) by importing the deck_mcp server with 'deck' prefix into the main AnkiConnectMCP.await anki_mcp.import_server("deck", deck_mcp)
- src/anki_mcp/deck_service.py:8-8 (registration)Creates the FastMCP instance named 'AnkiDeckService' to which the deck tools, including changeDeck, are registered via decorators.deck_mcp = FastMCP(name="AnkiDeckService")