Skip to main content
Glama

model_field_reposition

Reposition fields in Anki note templates by specifying model name, field name, and new index for improved organization and workflow.

Input Schema

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

Implementation Reference

  • The asynchronous handler function that implements the core logic of the 'model_field_reposition' tool. It calls the Anki client to reposition the specified field in the model and returns a success message or throws an error.
    async ({ modelName, fieldName, index }) => { try { await ankiClient.model.modelFieldReposition({ modelName, fieldName, index, }); return { content: [ { type: 'text', text: `Successfully repositioned field "${fieldName}" to position ${index} in model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to reposition field "${fieldName}" in model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } }
  • Zod schema validating the input parameters for the 'model_field_reposition' tool: modelName (string), fieldName (string), and index (number).
    { modelName: z.string().describe('Name of the model'), fieldName: z.string().describe('Name of the field to reposition'), index: z.number().describe('New position for the field (0-based)'), },
  • The server.tool() call that registers the 'model_field_reposition' tool with the MCP server, including its name, input schema, and handler function.
    server.tool( 'model_field_reposition', { modelName: z.string().describe('Name of the model'), fieldName: z.string().describe('Name of the field to reposition'), index: z.number().describe('New position for the field (0-based)'), }, async ({ modelName, fieldName, index }) => { try { await ankiClient.model.modelFieldReposition({ modelName, fieldName, index, }); return { content: [ { type: 'text', text: `Successfully repositioned field "${fieldName}" to position ${index} in model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to reposition field "${fieldName}" 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