Skip to main content
Glama

card_areSuspended

Check if specific Anki flashcards are suspended by providing card IDs, returning a boolean status for each card to help manage study sessions.

Instructions

Returns an array indicating whether each given card is suspended. Each item is boolean or null if the card doesn't exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardsYesA list of card IDs.

Implementation Reference

  • The core handler function for the 'card_areSuspended' tool (prefixed from 'areSuspended'). It takes a list of card IDs and returns whether each is suspended by calling the AnkiConnect 'areSuspended' API.
    @card_mcp.tool( name="areSuspended", description="Returns an array indicating whether each given card is suspended. Each item is boolean or null if the card doesn't exist.", ) async def check_cards_suspended_tool( cards: Annotated[List[int], Field(description="A list of card IDs.")], ) -> List[Optional[bool]]: return await anki_call("areSuspended", cards=cards)
  • Registration of the card service into the main MCP server, prefixing its tools with 'card_' (e.g., 'areSuspended' becomes 'card_areSuspended').
    await anki_mcp.import_server("card", card_mcp)
  • Helper function used by all tool handlers to make HTTP calls to the 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
  • Import of the card_mcp server instance.
    from .card_service import card_mcp

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