model_field_remove
Remove a specified field from a model within Anki MCP by providing the model name and field name, streamlining model customization and maintenance.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fieldName | Yes | Name of the field to remove | |
| modelName | Yes | Name of the model |
Implementation Reference
- src/tools/model.ts:144-163 (handler)The handler function that executes the model_field_remove tool. It calls the AnkiConnect modelFieldRemove method and returns a success message or throws an error.async ({ modelName, fieldName }) => { try { await ankiClient.model.modelFieldRemove({ modelName, fieldName, }); return { content: [ { type: 'text', text: `Successfully removed field "${fieldName}" from model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to remove field "${fieldName}" from model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } }
- src/tools/model.ts:140-143 (schema)Zod input schema defining parameters modelName and fieldName for the tool.{ modelName: z.string().describe('Name of the model'), fieldName: z.string().describe('Name of the field to remove'), },
- src/tools/model.ts:139-164 (registration)The server.tool call that registers the model_field_remove tool with its schema and handler within registerModelTools.'model_field_remove', { modelName: z.string().describe('Name of the model'), fieldName: z.string().describe('Name of the field to remove'), }, async ({ modelName, fieldName }) => { try { await ankiClient.model.modelFieldRemove({ modelName, fieldName, }); return { content: [ { type: 'text', text: `Successfully removed field "${fieldName}" from model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to remove field "${fieldName}" from model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } } );