card_suspended
Check if a specific Anki flashcard is suspended by its ID to verify study status and manage card visibility.
Instructions
Checks if a single card is suspended by its ID. Returns true if suspended, false otherwise.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| card | Yes | The ID of the card. |
Implementation Reference
- src/anki_mcp/card_service.py:63-70 (handler)Handler for the 'suspended' tool (prefixed to 'card_suspended' by the main server). Calls AnkiConnect's 'suspended' action to check if a card is suspended.@card_mcp.tool( name="suspended", description="Checks if a single card is suspended by its ID. Returns true if suspended, false otherwise.", ) async def check_card_suspended_tool( card: Annotated[int, Field(description="The ID of the card.")], ) -> bool: return await anki_call("suspended", card=card)
- src/anki_mcp/__init__.py:25-25 (registration)Registers the card_mcp tools with 'card' prefix in the main AnkiMCP server, making 'suspended' available as 'card_suspended'.await anki_mcp.import_server("card", card_mcp)
- src/anki_mcp/common.py:8-23 (helper)Common helper function used by all tool handlers to invoke AnkiConnect API endpoints 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
- src/anki_mcp/card_service.py:8-8 (registration)Creates the FastMCP instance for card-related tools, where individual tools like 'suspended' are registered via decorators.card_mcp = FastMCP(name="AnkiCardService")