Skip to main content
Glama

answer_cards

Process and record user responses to flashcards by submitting card IDs and ease ratings (1-4) for effective spaced repetition learning.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
answersYesArray of card answers

Implementation Reference

  • Exact implementation of the 'answer_cards' MCP tool: registers the tool with input schema (array of {cardId, ease}) and handler that invokes ankiClient.card.answerCards, processes results, and returns formatted response.
    'answer_cards', { answers: z .array( z.object({ cardId: z.number().describe('ID of the card to answer'), ease: z .number() .min(1) .max(4) .describe('Ease rating: 1 (Again), 2 (Hard), 3 (Good), 4 (Easy)'), }) ) .describe('Array of card answers'), }, async ({ answers }) => { try { const results = await ankiClient.card.answerCards({ answers }); const successCount = results.filter(Boolean).length; const failureCount = results.length - successCount; return { content: [ { type: 'text', text: `Answered ${successCount} cards successfully, ${failureCount} failed. Results: ${JSON.stringify(results)}`, }, ], }; } catch (error) { throw new Error( `Failed to answer cards: ${error instanceof Error ? error.message : String(error)}` ); } } );
  • Zod schema defining the input parameters for the 'answer_cards' tool.
    { answers: z .array( z.object({ cardId: z.number().describe('ID of the card to answer'), ease: z .number() .min(1) .max(4) .describe('Ease rating: 1 (Again), 2 (Hard), 3 (Good), 4 (Easy)'), }) ) .describe('Array of card answers'), },
  • Handler function that executes the tool logic: calls AnkiConnect's answerCards, counts successes/failures, and returns a text response.
    async ({ answers }) => { try { const results = await ankiClient.card.answerCards({ answers }); const successCount = results.filter(Boolean).length; const failureCount = results.length - successCount; return { content: [ { type: 'text', text: `Answered ${successCount} cards successfully, ${failureCount} failed. Results: ${JSON.stringify(results)}`, }, ], }; } catch (error) { throw new Error( `Failed to answer cards: ${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