Skip to main content
Glama

model_template_reposition

Reposition templates within a model on Anki MCP by specifying the model name, template name, and desired 0-based index for the new position.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYesNew position for the template (0-based)
modelNameYesName of the model
templateNameYesName of the template to reposition

Implementation Reference

  • Registration of the 'model_template_reposition' MCP tool using server.tool, including inline schema and handler function that delegates to ankiClient.model.modelTemplateReposition.
    'model_template_reposition', { modelName: z.string().describe('Name of the model'), templateName: z.string().describe('Name of the template to reposition'), index: z.number().describe('New position for the template (0-based)'), }, async ({ modelName, templateName, index }) => { try { await ankiClient.model.modelTemplateReposition({ modelName, templateName, index, }); return { content: [ { type: 'text', text: `Successfully repositioned template "${templateName}" to position ${index} in model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to reposition template "${templateName}" in model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } } );
  • Handler function executing the tool logic: repositions the template in the model via AnkiConnect client and returns success/error response.
    async ({ modelName, templateName, index }) => { try { await ankiClient.model.modelTemplateReposition({ modelName, templateName, index, }); return { content: [ { type: 'text', text: `Successfully repositioned template "${templateName}" to position ${index} in model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to reposition template "${templateName}" in model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } }
  • Zod schema defining input parameters for the model_template_reposition tool.
    { modelName: z.string().describe('Name of the model'), templateName: z.string().describe('Name of the template to reposition'), index: z.number().describe('New position for the template (0-based)'), },

Other Tools

Related 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/arielbk/anki-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server