Skip to main content
Glama

deck_createDeck

Create a new empty Anki flashcard deck by specifying its name. The tool prevents overwriting existing decks and returns the unique deck ID upon successful creation.

Instructions

Creates a new empty deck. Will not overwrite an existing deck with the same name. Returns the ID of the created deck.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deckYesThe name of the deck to create (e.g., 'Japanese::Tokyo').

Implementation Reference

  • The core handler function for the 'deck_createDeck' tool (local name 'createDeck'), which creates a new Anki deck using the AnkiConnect API. Includes inline schema via Annotated and Field.
    @deck_mcp.tool(
        name="createDeck",
        description="Creates a new empty deck. Will not overwrite an existing deck with the same name. Returns the ID of the created deck.",
    )
    async def create_deck_tool(
        deck: Annotated[
            str,
            Field(description="The name of the deck to create (e.g., 'Japanese::Tokyo')."),
        ],
    ) -> int:
        return await anki_call("createDeck", deck=deck)
  • Registration of service MCPS into the main anki_mcp, specifically the 'deck' namespace import which prefixes deck_mcp tools like 'createDeck' to become 'deck_createDeck'.
    await anki_mcp.import_server("deck", deck_mcp)
    await anki_mcp.import_server("note", note_mcp)
    await anki_mcp.import_server("card", card_mcp)
    await anki_mcp.import_server("model", model_mcp)
    await anki_mcp.import_server("media", media_mcp)
  • The supporting anki_call utility function that performs HTTP requests to AnkiConnect API, used by the deck_createDeck 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                                                                        
  • Creation of the deck_mcp FastMCP instance where the deck_createDeck tool is defined via decorator.
    deck_mcp = FastMCP(name="AnkiDeckService")
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it's a creation operation (implies mutation), specifies non-overwriting behavior, and mentions the return value (ID). It lacks details on permissions, error handling, or side effects, but covers essential behavior adequately for a simple tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core action ('Creates a new empty deck'), followed by important behavioral notes and return information in just two sentences. Every sentence adds value: the first states the purpose, the second clarifies constraints and outcomes, with zero waste or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is reasonably complete: it covers purpose, behavior, and return value. However, it could be more thorough by addressing potential errors or prerequisites, slightly reducing completeness for a mutation tool without annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'deck' fully documented in the schema. The description does not add any additional meaning beyond the schema's details (e.g., no extra context on naming conventions or constraints), so it meets the baseline of 3 for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('creates') and resource ('new empty deck'), distinguishing it from siblings like deck_deleteDecks (deletion) or deck_changeDeck (modification). It specifies the outcome ('empty deck') and what it returns ('ID of the created deck'), making the purpose unambiguous and distinct.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by stating 'Will not overwrite an existing deck with the same name,' which suggests this tool is for initial creation, not updates. However, it does not explicitly name alternatives (e.g., deck_changeDeck for modifications) or provide broader context on when to use it versus other deck-related tools, leaving some guidance gaps.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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