Skip to main content
Glama

card_cardsInfo

Retrieve detailed information for specific Anki flashcards by providing their card IDs using this tool. It helps users efficiently manage and organize their flashcard data within the Anki ecosystem.

Instructions

Returns a list of objects containing information for each card ID provided.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardsYesA list of card IDs.

Implementation Reference

  • The core handler function for the 'cardsInfo' tool (prefixed to 'card_cardsInfo'), which retrieves detailed information for the provided card IDs by calling the AnkiConnect 'cardsInfo' API endpoint.
    @card_mcp.tool( name="cardsInfo", description="Returns a list of objects containing information for each card ID provided.", ) async def get_cards_info_tool( cards: Annotated[List[int], Field(description="A list of card IDs.")], ) -> List[Dict[str, Any]]: return await anki_call("cardsInfo", cards=cards)
  • Registers the card service MCP server with the prefix 'card', making all its tools (including 'cardsInfo') available under 'card_' prefix, e.g., 'card_cardsInfo'.
    await anki_mcp.import_server("card", card_mcp)
  • Helper function used by the handler to make HTTP requests to the AnkiConnect server (localhost:8765) for the 'cardsInfo' action.
    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

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