Skip to main content
Glama

card_setSpecificValueOfCard

Modify specific properties of an Anki flashcard by updating key-value pairs for a single card, returning success indicators for each change.

Instructions

Sets specific values of a single card. Use with caution. Returns list of booleans indicating success for each key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardYesThe ID of the card to modify.
keysYesList of card property keys to change (e.g., 'flags', 'odue').
newValuesYesList of new values corresponding to the keys.
warning_checkNoSet to True for potentially risky operations.

Implementation Reference

  • Handler function implementing the tool logic for 'card_setSpecificValueOfCard' (registered as 'setSpecificValueOfCard' on card_mcp, prefixed later). Includes input schema via Annotated Fields and calls AnkiConnect API.
    @card_mcp.tool(
        name="setSpecificValueOfCard",
        description="Sets specific values of a single card. Use with caution. Returns list of booleans indicating success for each key.",
    )
    async def set_specific_card_value_tool(
        card: Annotated[int, Field(description="The ID of the card to modify.")],
        keys: Annotated[
            List[str],
            Field(
                description="List of card property keys to change (e.g., 'flags', 'odue')."
            ),
        ],
        newValues: Annotated[
            List[Any],                                                             
            Field(description="List of new values corresponding to the keys."),
        ],
        warning_check: Annotated[
            Optional[bool],
            Field(description="Set to True for potentially risky operations."),
        ] = None,
    ) -> List[bool]:
        params: Dict[str, Any] = {"card": card, "keys": keys, "newValues": newValues}
        if warning_check is not None:
            params["warning_check"] = warning_check
        return await anki_call("setSpecificValueOfCard", **params)
  • Creation of the card_mcp FastMCP instance on which the tool is registered via decorator.
    card_mcp = FastMCP(name="AnkiCardService")
  • Mounts the card_mcp server into the main anki_mcp under 'card' namespace, prefixing tool names with 'card_' to produce 'card_setSpecificValueOfCard'.
    await anki_mcp.import_server("card", card_mcp)
  • Helper function used by the tool handler to invoke the AnkiConnect 'setSpecificValueOfCard' action via HTTP POST.
    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                                                                        
Behavior3/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 the return value ('Returns list of booleans indicating success for each key') and hints at risk ('Use with caution'), but lacks details on permissions, rate limits, error handling, or what constitutes 'success' (e.g., validation rules). The warning about caution is vague without specifics.

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 two sentences, front-loaded with the core action and risk warning, followed by return value information. Every sentence adds value without redundancy, making it efficient and well-structured.

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

Completeness3/5

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

Given no annotations and no output schema, the description partially compensates by explaining the return format. However, for a mutation tool with 4 parameters and potential risk ('Use with caution'), it lacks details on error conditions, side effects, or examples of safe usage, leaving gaps in completeness.

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 all parameters well. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't clarify the relationship between 'keys' and 'newValues' or provide examples beyond 'flags', 'odue'). Baseline 3 is appropriate as the schema handles most of the documentation.

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 ('Sets') and resource ('specific values of a single card'), making the purpose understandable. However, it doesn't explicitly differentiate this from similar sibling tools like 'note_updateNote' or 'card_unsuspend', which could involve modifying card properties in different ways.

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 includes 'Use with caution', which provides some guidance about risk, but it doesn't specify when to use this tool versus alternatives (e.g., 'note_updateNote' for note-level changes or 'card_suspend' for suspension). No explicit when-not-to-use or prerequisite information is provided.

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