Skip to main content
Glama

model_modelStyling

Retrieve CSS styling for a specific Anki flashcard model by providing the model name. Returns an object with the 'css' field, enabling custom styling for improved flashcard presentation.

Instructions

Gets the CSS styling for the provided model name. Returns an object containing the 'css' field.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNameYesThe name of the model.

Implementation Reference

  • The handler function for the tool 'modelStyling' (exposed as 'model_modelStyling'), which fetches the CSS styling for a given Anki model name via the AnkiConnect API.
    @model_mcp.tool( name="modelStyling", description="Gets the CSS styling for the provided model name. Returns an object containing the 'css' field.", ) async def get_model_styling_tool( modelName: Annotated[str, Field(description="The name of the model.")], ) -> Dict[str, Any]: return await anki_call("modelStyling", modelName=modelName)
  • Top-level registration of the model service tools into the main MCP server with 'model_' prefix, making 'modelStyling' available as 'model_modelStyling'.
    await anki_mcp.import_server("model", model_mcp)
  • Pydantic schema definition for the tool's input parameter 'modelName'.
    modelName: Annotated[str, Field(description="The name of the model.")],
  • Utility function `anki_call` invoked by the handler to communicate with the AnkiConnect API, handling the HTTP POST request and error checking.
    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

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