Skip to main content
Glama

gui_add_cards

Add structured notes to a specified Anki deck using a chosen note model, populate fields, and assign tags for organized study material

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deckNameYesName of the deck to add the note to
fieldsYesObject with field names as keys and field content as values
modelNameYesName of the note model/type
tagsNoArray of tags to add to the note

Implementation Reference

  • Executes the tool logic by constructing a note object from inputs and calling ankiClient.graphical.guiAddCards to open Anki's Add Cards GUI dialog.
    async ({ deckName, modelName, fields, tags }) => { try { const note = { deckName, modelName, fields, tags: tags || [], }; const result = await ankiClient.graphical.guiAddCards({ note }); return { content: [ { type: 'text', text: `Opened Add Cards dialog and added note with ID: ${result}`, }, ], }; } catch (error) { throw new Error( `Failed to open Add Cards dialog: ${error instanceof Error ? error.message : String(error)}` ); } }
  • Zod schema defining the input parameters for the gui_add_cards tool: deckName (string), modelName (string), fields (record<string,string>), tags (optional array<string>).
    { deckName: z.string().describe('Name of the deck to add the note to'), modelName: z.string().describe('Name of the note model/type'), fields: z .record(z.string()) .describe('Object with field names as keys and field content as values'), tags: z.array(z.string()).optional().describe('Array of tags to add to the note'), },
  • Registers the 'gui_add_cards' MCP tool with the server, specifying name, input schema, and handler function.
    'gui_add_cards', { deckName: z.string().describe('Name of the deck to add the note to'), modelName: z.string().describe('Name of the note model/type'), fields: z .record(z.string()) .describe('Object with field names as keys and field content as values'), tags: z.array(z.string()).optional().describe('Array of tags to add to the note'), }, async ({ deckName, modelName, fields, tags }) => { try { const note = { deckName, modelName, fields, tags: tags || [], }; const result = await ankiClient.graphical.guiAddCards({ note }); return { content: [ { type: 'text', text: `Opened Add Cards dialog and added note with ID: ${result}`, }, ], }; } catch (error) { throw new Error( `Failed to open Add Cards dialog: ${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