Skip to main content
Glama

model_updateModelStyling

Update CSS styling for Anki flashcard templates to customize appearance and formatting.

Instructions

Modifies the CSS styling of an existing model by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel object. Must include 'name' (model name) and 'css' (the new CSS string).

Implementation Reference

  • The handler function that implements the tool's logic by calling the AnkiConnect 'updateModelStyling' API with the provided model object.
    async def update_model_styling_tool(
        model: Annotated[
            Dict[str, Any],
            Field(
                description="Model object. Must include 'name' (model name) and 'css' (the new CSS string)."
            ),
        ],
    ) -> None:
        return await anki_call("updateModelStyling", model=model)
  • Registers the tool handler with name 'updateModelStyling' and description in the model_mcp FastMCP instance.
    @model_mcp.tool(
        name="updateModelStyling",
        description="Modifies the CSS styling of an existing model by name.",
    )
  • Registers the model_mcp server (containing the tool) under the 'model' prefix in the main AnkiConnectMCP, making the tool available as 'model_updateModelStyling'.
    await anki_mcp.import_server("model", model_mcp)
  • Helper function used by the tool handler to make HTTP calls 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                                                                        
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'modifies' implying a mutation, but doesn't describe permissions required, whether changes are reversible, error handling (e.g., if model doesn't exist), or rate limits. This is a significant gap for a mutation tool with zero annotation coverage.

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 a single, efficient sentence that front-loads the core action and resource. It wastes no words and is appropriately sized for the tool's complexity, 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?

Given the tool's mutation nature, lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like side effects, error cases, or return values, leaving the agent with insufficient context to use the tool safely and effectively.

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 schema documenting that the 'model' parameter must include 'name' and 'css'. The description adds no additional parameter semantics beyond what's in the schema, such as format details for CSS or name constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('modifies') and target resource ('CSS styling of an existing model by name'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'model_modelStyling' or 'model_updateModelTemplates', which might handle related styling or template updates, leaving some ambiguity about when to choose this specific tool.

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. It mentions 'existing model by name' but doesn't specify prerequisites (e.g., model must exist) or contrast with tools like 'model_modelStyling' (which might retrieve styling) or 'model_updateModelTemplates' (which updates templates). Without such context, the agent lacks clear usage direction.

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