Skip to main content
Glama

model_modelTemplates

Retrieve card template content for Anki flashcard models to review or modify formatting and structure.

Instructions

Returns an object indicating the template content for each card of the specified model.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNameYesThe name of the model.

Implementation Reference

  • The core handler function for the 'model_modelTemplates' tool (prefixed due to model_ namespace). It takes a modelName parameter, calls the AnkiConnect 'modelTemplates' API via anki_call helper, and returns the templates dictionary.
    @model_mcp.tool(
        name="modelTemplates",
        description="Returns an object indicating the template content for each card of the specified model.",
    )
    async def get_model_templates_tool(
        modelName: Annotated[str, Field(description="The name of the model.")],
    ) -> Dict[str, Any]:                                                                 
        return await anki_call("modelTemplates", modelName=modelName)
  • Creates the sub-MCP server 'model_mcp' (AnkiModelService) where the model_modelTemplates tool is registered via decorator.
    model_mcp = FastMCP(name="AnkiModelService")
  • Registers the model_mcp sub-server under the 'model' prefix to the main 'AnkiConnectMCP' server, enabling the full tool name 'model_modelTemplates'.
    await anki_mcp.import_server("model", model_mcp)
  • Shared helper function that performs HTTP requests to the AnkiConnect API (localhost:8765), used by the tool handler to execute the 'modelTemplates' action.
    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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It indicates a read operation ('Returns'), but fails to describe potential side effects, error conditions, authentication needs, or rate limits. This leaves significant gaps in understanding how the tool behaves in practice, especially for a tool that might involve data retrieval from a model.

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 directly states the tool's function without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly, which is ideal for conciseness.

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?

For a tool with one parameter (fully documented in the schema) and no output schema, the description provides a basic understanding of what the tool does. However, it lacks details on the return format (e.g., structure of the 'object' or 'template content'), error handling, or integration with sibling tools, making it minimally adequate but incomplete for informed use.

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?

The input schema has 100% description coverage, with 'modelName' clearly documented as 'The name of the model.' The description adds no additional meaning beyond this, such as format examples or constraints. Given the high schema coverage, a baseline score of 3 is appropriate, as the description does not compensate but also does not detract.

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 ('Returns') and the resource ('template content for each card of the specified model'), making the purpose understandable. However, it does not explicitly differentiate this tool from its sibling 'model_updateModelTemplates', which appears to be a related write operation, leaving some ambiguity about when to choose one over the other.

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, such as 'model_modelNamesAndIds' for listing models or 'model_updateModelTemplates' for modifying templates. It lacks context about prerequisites, typical use cases, or exclusions, offering minimal 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