card_unsuspend
Reactivate suspended Anki flashcards by providing their card IDs. This tool enables users to restore access to specific cards, ensuring they remain active for study and review.
Instructions
Unsuspends the specified cards. Returns true on success.
Input Schema
TableJSON 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 for the 'card_unsuspend' tool. It takes a list of card IDs and unsuspends them by calling the AnkiConnect 'unsuspend' API endpoint.@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:25-25 (registration)Registers the card service MCP server with the 'card' prefix, making the 'unsuspend' tool available as 'card_unsuspend'.await anki_mcp.import_server("card", card_mcp)
- src/anki_mcp/common.py:8-23 (helper)Helper function used by all tool handlers to invoke AnkiConnect API actions asynchronously via HTTP POST.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