Skip to main content
Glama

deck_deleteDecks

Delete Anki decks and their cards by specifying deck names and confirming card deletion.

Instructions

Deletes decks with the given names. The 'cardsToo' argument must be specified and set to true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
decksYesA list of deck names to delete.
cardsTooYesMust be true to confirm deletion of cards within the decks.

Implementation Reference

  • The handler function `delete_decks_tool` that implements the core logic of the `deck_deleteDecks` tool. It performs validation on the `cardsToo` parameter and invokes the AnkiConnect `deleteDecks` API via `anki_call`.
    @deck_mcp.tool(
        name="deleteDecks",
        description="Deletes decks with the given names. The 'cardsToo' argument must be specified and set to true.",
    )
    async def delete_decks_tool(
        decks: Annotated[List[str], Field(description="A list of deck names to delete.")],
        cardsToo: Annotated[
            bool,
            Field(
                description="Must be true to confirm deletion of cards within the decks."
            ),
        ],
    ) -> None:
        if not cardsToo:
            raise ValueError("cardsToo must be true to delete decks.")
        return await anki_call("deleteDecks", decks=decks, cardsToo=cardsToo)
  • Registers the `deck_mcp` tools (including `deleteDecks`) with the `deck_` prefix in the main `anki_mcp` server, resulting in the tool name `deck_deleteDecks`.
    await anki_mcp.import_server("deck", deck_mcp)
  • The `@deck_mcp.tool` decorator that registers the `delete_decks_tool` as the `deleteDecks` tool in the `deck_mcp` FastMCP instance.
    @deck_mcp.tool(
        name="deleteDecks",
        description="Deletes decks with the given names. The 'cardsToo' argument must be specified and set to true.",
  • The `anki_call` utility function used by the handler to make HTTP requests 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                                                                        
  • Pydantic schema definitions for the tool's input parameters using Annotated and Field.
        decks: Annotated[List[str], Field(description="A list of deck names to delete.")],
        cardsToo: Annotated[
            bool,
            Field(
                description="Must be true to confirm deletion of cards within the decks."
            ),
        ],
    ) -> None:
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the 'cardsToo' argument requirement, which hints at a safety confirmation, but doesn't describe critical behaviors like whether deletion is permanent, requires specific permissions, affects related data beyond cards, or provides any response format. For a destructive operation, this is inadequate.

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 extremely concise with two sentences that directly address the core action and a critical parameter requirement. Every word serves a purpose with no wasted information, making it easy to parse quickly.

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

Completeness2/5

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

For a destructive tool with no annotations and no output schema, the description is insufficient. It doesn't cover behavioral aspects like permanence, error conditions, or response format, nor does it provide usage context relative to sibling tools. The high schema coverage doesn't compensate for these gaps in a mutation operation.

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%, so the schema already documents both parameters fully. The description adds minimal value by emphasizing that 'cardsToo' must be true, but doesn't explain why or provide additional context beyond what's in the schema descriptions. This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the verb ('Deletes') and resource ('decks with the given names'), making the purpose unambiguous. It doesn't explicitly differentiate from sibling tools like 'note_deleteNotes' or 'media_deleteMediaFile', but the resource specificity is sufficient for clarity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'note_deleteNotes' or general deletion tools. It mentions the 'cardsToo' argument requirement but doesn't explain why this tool is preferred over others for deck deletion scenarios.

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