Skip to main content
Glama

find_cards

Search and retrieve specific cards in Anki using a custom query. Input a search string to locate relevant flashcards for efficient review and organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesAnki search query to find cards

Implementation Reference

  • The complete registration of the 'find_cards' tool using server.tool(), including the input schema (query: z.string()) and the handler function that executes ankiClient.card.findCards({ query }) to retrieve matching card IDs and formats the response.
    'find_cards', { query: z.string().describe('Anki search query to find cards'), }, async ({ query }) => { try { const cardIds = await ankiClient.card.findCards({ query }); return { content: [ { type: 'text', text: `Found ${cardIds.length} cards matching query "${query}": ${JSON.stringify(cardIds)}`, }, ], }; } catch (error) { throw new Error( `Failed to find cards: ${error instanceof Error ? error.message : String(error)}` ); } } );
  • The handler function for the 'find_cards' tool, which takes a query string, calls the Anki API via ankiClient.card.findCards, and returns a formatted text response with the list of found card IDs.
    async ({ query }) => { try { const cardIds = await ankiClient.card.findCards({ query }); return { content: [ { type: 'text', text: `Found ${cardIds.length} cards matching query "${query}": ${JSON.stringify(cardIds)}`, }, ], }; } catch (error) { throw new Error( `Failed to find cards: ${error instanceof Error ? error.message : String(error)}` ); } }
  • The Zod input schema for the 'find_cards' tool, defining a single 'query' parameter as a string describing the Anki search query.
    { query: z.string().describe('Anki search query to find cards'), },

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