model_modelFieldNames
Retrieve field names for a specific model in Anki flashcards using the Anki-MCP server. Input the model name to generate a structured list of fields for efficient data management and organization.
Instructions
Gets the list of field names for the provided model name.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| modelName | Yes | The name of the model. |
Implementation Reference
- src/anki_mcp/model_service.py:29-36 (handler)The core handler function implementing the 'model_modelFieldNames' tool logic by invoking AnkiConnect's 'modelFieldNames' API.@model_mcp.tool( name="modelFieldNames", description="Gets the list of field names for the provided model name.", ) async def get_model_field_names_tool( modelName: Annotated[str, Field(description="The name of the model.")], ) -> List[str]: return await anki_call("modelFieldNames", modelName=modelName)
- src/anki_mcp/__init__.py:22-29 (registration)Registers all service MCPs into the main anki_mcp, specifically importing 'model' service which prefixes tools like 'modelFieldNames' to become 'model_modelFieldNames'.async def setup(run_server: bool = True): await anki_mcp.import_server("deck", deck_mcp) await anki_mcp.import_server("note", note_mcp) await anki_mcp.import_server("card", card_mcp) await anki_mcp.import_server("model", model_mcp) await anki_mcp.import_server("media", media_mcp) if run_server: await anki_mcp.run_async()
- src/anki_mcp/model_service.py:29-36 (schema)Defines the input schema (modelName: str) and output (List[str]) for the tool via Pydantic annotations in the handler.@model_mcp.tool( name="modelFieldNames", description="Gets the list of field names for the provided model name.", ) async def get_model_field_names_tool( modelName: Annotated[str, Field(description="The name of the model.")], ) -> List[str]: return await anki_call("modelFieldNames", modelName=modelName)