Skip to main content
Glama

check_cards_suspended

Identify and verify suspended card IDs on Anki MCP by inputting an array of card IDs for accurate status checks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardIdsYesArray of card IDs to check

Implementation Reference

  • Handler function that executes the 'check_cards_suspended' tool logic: queries Anki via ankiClient to check suspension status for given card IDs, computes count, and returns formatted text response with details.
    async ({ cardIds }) => { try { const areSuspended = await ankiClient.card.areSuspended({ cards: cardIds }); const result = cardIds.map((cardId, index) => ({ cardId, isSuspended: areSuspended[index], })); const suspendedCount = areSuspended.filter((status) => status === true).length; return { content: [ { type: 'text', text: `${suspendedCount} out of ${cardIds.length} cards are suspended. Details: ${JSON.stringify(result)}`, }, ], }; } catch (error) { throw new Error( `Failed to check if cards are suspended: ${error instanceof Error ? error.message : String(error)}` ); } }
  • Input schema using Zod for validating the 'cardIds' parameter as an array of numbers.
    { cardIds: z.array(z.number()).describe('Array of card IDs to check'), },
  • MCP tool registration call using server.tool(), specifying the tool name, input schema, and handler function.
    'check_cards_suspended', { cardIds: z.array(z.number()).describe('Array of card IDs to check'), }, async ({ cardIds }) => { try { const areSuspended = await ankiClient.card.areSuspended({ cards: cardIds }); const result = cardIds.map((cardId, index) => ({ cardId, isSuspended: areSuspended[index], })); const suspendedCount = areSuspended.filter((status) => status === true).length; return { content: [ { type: 'text', text: `${suspendedCount} out of ${cardIds.length} cards are suspended. Details: ${JSON.stringify(result)}`, }, ], }; } catch (error) { throw new Error( `Failed to check if cards are suspended: ${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