model_field_set_font_size
Adjust the font size for a specific field within a model in Anki MCP. Specify the model name, field name, and desired font size to customize the display.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fieldName | Yes | Name of the field | |
| fontSize | Yes | Font size to set | |
| modelName | Yes | Name of the model |
Implementation Reference
- src/tools/model.ts:291-319 (registration)Complete registration of the MCP tool 'model_field_set_font_size', including input schema (modelName, fieldName, fontSize) and handler logic that calls AnkiConnect's modelFieldSetFontSize via ankiClient to set the font size for a model field and returns a formatted success message.server.tool( 'model_field_set_font_size', { modelName: z.string().describe('Name of the model'), fieldName: z.string().describe('Name of the field'), fontSize: z.number().describe('Font size to set'), }, async ({ modelName, fieldName, fontSize }) => { try { await ankiClient.model.modelFieldSetFontSize({ modelName, fieldName, fontSize, }); return { content: [ { type: 'text', text: `Successfully set font size ${fontSize} for field "${fieldName}" in model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to set font size for field "${fieldName}" in model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } } );
- src/tools/model.ts:298-319 (handler)The core handler function that executes the tool logic by invoking the underlying AnkiConnect API.async ({ modelName, fieldName, fontSize }) => { try { await ankiClient.model.modelFieldSetFontSize({ modelName, fieldName, fontSize, }); return { content: [ { type: 'text', text: `Successfully set font size ${fontSize} for field "${fieldName}" in model "${modelName}"`, }, ], }; } catch (error) { throw new Error( `Failed to set font size for field "${fieldName}" in model "${modelName}": ${error instanceof Error ? error.message : String(error)}` ); } } );
- src/tools/model.ts:293-297 (schema)Zod schema defining the input parameters for the tool.{ modelName: z.string().describe('Name of the model'), fieldName: z.string().describe('Name of the field'), fontSize: z.number().describe('Font size to set'), },