Skip to main content
Glama

deck_getDeckConfig

Retrieve configuration settings for a specific Anki flashcard deck to manage study parameters and review options.

Instructions

Gets the configuration group object for the given deck name. Returns the deck configuration object.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deckYesThe name of the deck (e.g., 'Default').

Implementation Reference

  • The main handler function for the 'deck_getDeckConfig' tool. It takes a deck name, calls the AnkiConnect 'getDeckConfig' API via anki_call, and returns the config. The @tool decorator registers it with name 'getDeckConfig' to deck_mcp; prefixed to 'deck_getDeckConfig' on import.
    @deck_mcp.tool( name="getDeckConfig", description="Gets the configuration group object for the given deck name. Returns the deck configuration object.", ) async def get_deck_config_tool( deck: Annotated[str, Field(description="The name of the deck (e.g., 'Default').")], ) -> Dict[str, Any]: return await anki_call("getDeckConfig", deck=deck)
  • Registers all tools from deck_mcp (including getDeckConfig) into the main anki_mcp server with the 'deck_' prefix, resulting in the tool name 'deck_getDeckConfig'.
    await anki_mcp.import_server("deck", deck_mcp)
  • Pydantic schema definition for the input parameter 'deck' using Annotated and Field.
    deck: Annotated[str, Field(description="The name of the deck (e.g., 'Default').")],
  • Helper function that performs the HTTP POST to AnkiConnect API, handles errors, and returns the result. Used by the tool handler.
    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