Skip to main content
Glama

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
NameRequiredDescriptionDefault
cardsYesA list of card IDs to suspend.

Implementation Reference

  • 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)
  • Registers the card service (including 'suspend' tool as 'card_suspend') into the main AnkiConnectMCP server.
    await anki_mcp.import_server("card", card_mcp)
  • 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
  • Creates the FastMCP instance for card service, to which the suspend tool is registered.
    card_mcp = FastMCP(name="AnkiCardService")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ujisati/anki-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server