Skip to main content
Glama

model_updateModelTemplates

Update templates of an existing Anki flashcard model by specifying the model name and defining new Front/Back templates.

Instructions

Modifies the templates of an existing model by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel object. Must include 'name' (model name) and 'templates' (dict of template name to Front/Back definitions).

Implementation Reference

  • Handler function for the 'model_updateModelTemplates' tool (registered as 'updateModelTemplates' in model service, prefixed to 'model_' upon import). Takes a model dict with name and templates, calls AnkiConnect's updateModelTemplates.
    @model_mcp.tool( name="updateModelTemplates", description="Modifies the templates of an existing model by name.", ) async def update_model_templates_tool( model: Annotated[ Dict[str, Any], Field( description="Model object. Must include 'name' (model name) and 'templates' (dict of template name to Front/Back definitions)." ), ], ) -> None: return await anki_call("updateModelTemplates", model=model)
  • Imports the model_mcp server into the main anki_mcp, prefixing all its tool names with 'model_' (resulting in 'model_updateModelTemplates').
    await anki_mcp.import_server("model", model_mcp)
  • Input schema definition for the tool: a dictionary containing 'name' and 'templates' for the model.
    model: Annotated[ Dict[str, Any], Field( description="Model object. Must include 'name' (model name) and 'templates' (dict of template name to Front/Back definitions)." ), ], ) -> None:

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