card_unsuspend
Reactivate suspended Anki flashcards to resume studying. Specify card IDs to restore them to active review status.
Instructions
Unsuspends the specified cards. Returns true on success.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cards | Yes | A list of card IDs to unsuspend. |
Implementation Reference
- src/anki_mcp/card_service.py:82-89 (handler)The handler function `unsuspend_cards_tool` implements the logic for the `card_unsuspend` tool by calling AnkiConnect's unsuspend API via `anki_call`.
@card_mcp.tool( name="unsuspend", description="Unsuspends the specified cards. Returns true on success.", ) async def unsuspend_cards_tool( cards: Annotated[List[int], Field(description="A list of card IDs to unsuspend.")], ) -> bool: return await anki_call("unsuspend", cards=cards) - src/anki_mcp/__init__.py:22-29 (registration)Registers the card_mcp server (containing the unsuspend tool) into the main anki_mcp server with the "card_" prefix, making the tool available as "card_unsuspend".
async def setup(run_server: bool = True): await anki_mcp.import_server("deck", deck_mcp) await anki_mcp.import_server("note", note_mcp) await anki_mcp.import_server("card", card_mcp) await anki_mcp.import_server("model", model_mcp) await anki_mcp.import_server("media", media_mcp) if run_server: await anki_mcp.run_async() - src/anki_mcp/common.py:8-23 (helper)Supporting utility function `anki_call` that performs HTTP POST to AnkiConnect API, used by the tool handler to execute the unsuspend action.
async def anki_call(action: str, **params: Any) -> Any: async with httpx.AsyncClient() as client: payload = {"action": action, "version": 6, "params": params} result = await client.post(ANKICONNECT_URL, json=payload) result.raise_for_status() result_json = result.json() error = result_json.get("error") if error: raise Exception(f"AnkiConnect error for action '{action}': {error}") response = result_json.get("result") if "result" in result_json: return response return result_json