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
| Name | Required | Description | Default |
|---|---|---|---|
| deck | Yes | The name of the deck (e.g., 'Default'). |
Implementation Reference
- src/anki_mcp/deck_service.py:19-27 (handler)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) - src/anki_mcp/__init__.py:23-23 (registration)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) - src/anki_mcp/deck_service.py:24-24 (schema)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').")], - src/anki_mcp/common.py:8-23 (helper)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