Skip to main content
Glama

set_card_specific_values

Modify specific properties of an Anki card by setting new values for selected keys, such as due date, interval, or queue status, using the card ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardIdYesCard ID to modify
keysYesArray of card property keys to modify
newValuesYesArray of new values (must match the length of keys)

Implementation Reference

  • Handler function that executes the tool: validates input lengths, calls ankiClient.card.setSpecificValueOfCard to update card properties, and returns success status.
    async ({ cardId, keys, newValues }) => { try { if (keys.length !== newValues.length) { throw new Error('Number of keys must match number of new values'); } const results = await ankiClient.card.setSpecificValueOfCard({ card: cardId, keys, newValues, }); const successCount = results.filter(Boolean).length; return { content: [ { type: 'text', text: `Successfully updated ${successCount} out of ${keys.length} values for card ${cardId}`, }, ], }; } catch (error) { throw new Error( `Failed to set card values: ${error instanceof Error ? error.message : String(error)}` ); } } );
  • Input schema using Zod: cardId (number), keys (array of enum card properties), newValues (array of strings matching keys length).
    { cardId: z.number().describe('Card ID to modify'), keys: z .array( z.enum([ 'data', 'did', 'due', 'factor', 'flags', 'id', 'ivl', 'lapses', 'left', 'mod', 'odid', 'odue', 'ord', 'queue', 'reps', 'type', 'usn', ]) ) .describe('Array of card property keys to modify'), newValues: z .array(z.string()) .describe('Array of new values (must match the length of keys)'), },
  • Registration of the tool using server.tool(), including name, input schema, and handler function.
    server.tool( 'set_card_specific_values', { cardId: z.number().describe('Card ID to modify'), keys: z .array( z.enum([ 'data', 'did', 'due', 'factor', 'flags', 'id', 'ivl', 'lapses', 'left', 'mod', 'odid', 'odue', 'ord', 'queue', 'reps', 'type', 'usn', ]) ) .describe('Array of card property keys to modify'), newValues: z .array(z.string()) .describe('Array of new values (must match the length of keys)'), }, async ({ cardId, keys, newValues }) => { try { if (keys.length !== newValues.length) { throw new Error('Number of keys must match number of new values'); } const results = await ankiClient.card.setSpecificValueOfCard({ card: cardId, keys, newValues, }); const successCount = results.filter(Boolean).length; return { content: [ { type: 'text', text: `Successfully updated ${successCount} out of ${keys.length} values for card ${cardId}`, }, ], }; } catch (error) { throw new Error( `Failed to set card values: ${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