card_suspend
Manage Anki flashcards by suspending specific cards using their IDs. This tool ensures cards are temporarily disabled for review, optimizing your study sessions.
Instructions
Suspends the specified cards. Returns true on success.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cards | Yes | A list of card IDs to suspend. |
Implementation Reference
- src/anki_mcp/card_service.py:73-79 (handler)Handler function for the 'card_suspend' tool. It takes a list of card IDs and suspends them via AnkiConnect API.@card_mcp.tool( name="suspend", description="Suspends the specified cards. Returns true on success." ) async def suspend_cards_tool( cards: Annotated[List[int], Field(description="A list of card IDs to suspend.")], ) -> bool: return await anki_call("suspend", cards=cards)
- src/anki_mcp/__init__.py:25-25 (registration)Registers the card service (including 'suspend' tool as 'card_suspend') into the main AnkiConnectMCP server.await anki_mcp.import_server("card", card_mcp)
- src/anki_mcp/common.py:8-23 (helper)Helper function used by the handler to make HTTP POST requests to AnkiConnect API.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
- src/anki_mcp/card_service.py:8-8 (registration)Creates the FastMCP instance for card service, to which the suspend tool is registered.card_mcp = FastMCP(name="AnkiCardService")