Skip to main content
Glama

model_template_rename

Renames a template within a specified model on Anki MCP, allowing users to update template names for better organization and clarity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNameYesName of the model
newTemplateNameYesNew name for the template
oldTemplateNameYesCurrent name of the template

Implementation Reference

  • Handler function that performs the model template rename operation by calling the Anki client and handles success/error responses.
    async ({ modelName, oldTemplateName, newTemplateName }) => { try { await ankiClient.model.modelTemplateRename({ modelName, oldTemplateName, newTemplateName, }); return { content: [ { type: 'text', text: `Successfully renamed template "${oldTemplateName}" to "${newTemplateName}" in model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to rename template in model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } }
  • Input schema using Zod for validating parameters: modelName, oldTemplateName, newTemplateName.
    { modelName: z.string().describe('Name of the model'), oldTemplateName: z.string().describe('Current name of the template'), newTemplateName: z.string().describe('New name for the template'), },
  • Registration of the 'model_template_rename' tool with the MCP server, including the tool name, input schema, and handler function.
    server.tool( 'model_template_rename', { modelName: z.string().describe('Name of the model'), oldTemplateName: z.string().describe('Current name of the template'), newTemplateName: z.string().describe('New name for the template'), }, async ({ modelName, oldTemplateName, newTemplateName }) => { try { await ankiClient.model.modelTemplateRename({ modelName, oldTemplateName, newTemplateName, }); return { content: [ { type: 'text', text: `Successfully renamed template "${oldTemplateName}" to "${newTemplateName}" in model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to rename template in model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } } );

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