Skip to main content
Glama

model_field_rename

Rename a specific field within a named model in Anki MCP by providing the current and new field names. Streamline model updates for improved organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNameYesName of the model
newFieldNameYesNew name for the field
oldFieldNameYesCurrent name of the field

Implementation Reference

  • The handler function that performs the actual model field renaming by invoking ankiClient.model.modelFieldRename and returns a success message or throws an error.
    try { await ankiClient.model.modelFieldRename({ modelName, oldFieldName, newFieldName, }); return { content: [ { type: 'text', text: `Successfully renamed field "${oldFieldName}" to "${newFieldName}" in model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to rename field in model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } } );
  • Zod schema validating the input parameters for the tool: modelName (string), oldFieldName (string), newFieldName (string).
    modelName: z.string().describe('Name of the model'), oldFieldName: z.string().describe('Current name of the field'), newFieldName: z.string().describe('New name for the field'), }, async ({ modelName, oldFieldName, newFieldName }) => {
  • The registration of the 'model_field_rename' tool within the registerModelTools function using server.tool(name, inputSchema, handler).
    'model_field_rename', { modelName: z.string().describe('Name of the model'), oldFieldName: z.string().describe('Current name of the field'), newFieldName: z.string().describe('New name for the field'), }, async ({ modelName, oldFieldName, newFieldName }) => { try { await ankiClient.model.modelFieldRename({ modelName, oldFieldName, newFieldName, }); return { content: [ { type: 'text', text: `Successfully renamed field "${oldFieldName}" to "${newFieldName}" in model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to rename field 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