Skip to main content
Glama

gui_browse

Search and organize Anki cards using a query and optional sorting by column with ascending or descending order for efficient card management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to browse cards
reorderCardsNoOptional reordering configuration

Implementation Reference

  • The handler function that implements the core logic of the 'gui_browse' tool. It prepares parameters, invokes the underlying Anki graphical guiBrowse method, and returns a response with the number of cards found.
    async ({ query, reorderCards }) => { try { const params: any = { query }; if (reorderCards) { params.reorderCards = reorderCards; } const cardIds = await ankiClient.graphical.guiBrowse(params); return { content: [ { type: 'text', text: `Opened browser with query "${query}". Found ${cardIds.length} cards: ${JSON.stringify(cardIds)}`, }, ], }; } catch (error) { throw new Error( `Failed to open browser: ${error instanceof Error ? error.message : String(error)}` ); } }
  • Zod schema defining the input parameters for the 'gui_browse' tool: a required 'query' string and an optional 'reorderCards' object.
    { query: z.string().describe('Search query to browse cards'), reorderCards: z .object({ columnId: z.string().describe('Column to sort by'), order: z.enum(['ascending', 'descending']).describe('Sort order'), }) .optional() .describe('Optional reordering configuration'), },
  • The 'gui_browse' MCP tool is registered here within the registerGraphicalTools function using server.tool(), specifying the tool name, input schema, and handler implementation.
    server.tool( 'gui_browse', { query: z.string().describe('Search query to browse cards'), reorderCards: z .object({ columnId: z.string().describe('Column to sort by'), order: z.enum(['ascending', 'descending']).describe('Sort order'), }) .optional() .describe('Optional reordering configuration'), }, async ({ query, reorderCards }) => { try { const params: any = { query }; if (reorderCards) { params.reorderCards = reorderCards; } const cardIds = await ankiClient.graphical.guiBrowse(params); return { content: [ { type: 'text', text: `Opened browser with query "${query}". Found ${cardIds.length} cards: ${JSON.stringify(cardIds)}`, }, ], }; } catch (error) { throw new Error( `Failed to open browser: ${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