model_template_remove
Remove specific templates from models in Anki MCP by specifying the model name and template name to streamline card design updates.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| modelName | Yes | Name of the model | |
| templateName | Yes | Name of the template to remove |
Implementation Reference
- src/tools/model.ts:363-382 (handler)The handler function that executes the model_template_remove tool logic: calls ankiClient.model.modelTemplateRemove with modelName and templateName, returns success message or throws error.async ({ modelName, templateName }) => { try { await ankiClient.model.modelTemplateRemove({ modelName, templateName, }); return { content: [ { type: 'text', text: `Successfully removed template "${templateName}" from model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to remove template "${templateName}" from model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } }
- src/tools/model.ts:359-362 (schema)Zod schema for input validation of the model_template_remove tool: requires modelName and templateName as strings.{ modelName: z.string().describe('Name of the model'), templateName: z.string().describe('Name of the template to remove'), },
- src/tools/model.ts:357-383 (registration)Registration of the 'model_template_remove' tool on the MCP server, specifying name, input schema, and handler function.server.tool( 'model_template_remove', { modelName: z.string().describe('Name of the model'), templateName: z.string().describe('Name of the template to remove'), }, async ({ modelName, templateName }) => { try { await ankiClient.model.modelTemplateRemove({ modelName, templateName, }); return { content: [ { type: 'text', text: `Successfully removed template "${templateName}" from model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to remove template "${templateName}" from model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } } );