Skip to main content
Glama

get_collection_stats_html

Generate HTML-formatted statistics for Anki decks. Use this tool to analyze study progress by retrieving detailed metrics for either specific decks or the entire collection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wholeCollectionYesWhether to get stats for the whole collection

Implementation Reference

  • The main execution logic of the 'get_collection_stats_html' tool. It takes a boolean 'wholeCollection' parameter, fetches the HTML statistics from the Anki client, and returns an MCP-formatted response containing a description and the raw HTML.
    async ({ wholeCollection }) => { try { const statsHTML = await ankiClient.statistic.getCollectionStatsHTML({ wholeCollection }); return { content: [ { type: 'text', text: `Collection statistics retrieved (${wholeCollection ? 'whole collection' : 'current deck'})`, }, { type: 'text', text: statsHTML, }, ], }; } catch (error) { throw new Error( `Failed to get collection statistics: ${error instanceof Error ? error.message : String(error)}` ); } }
  • Input schema defined using Zod, specifying a single boolean parameter 'wholeCollection' to indicate if stats should cover the entire collection.
    { wholeCollection: z.boolean().describe('Whether to get stats for the whole collection'), },
  • Registers the 'get_collection_stats_html' tool on the MCP server, providing the tool name, input schema, and handler function.
    server.tool( 'get_collection_stats_html', { wholeCollection: z.boolean().describe('Whether to get stats for the whole collection'), }, async ({ wholeCollection }) => { try { const statsHTML = await ankiClient.statistic.getCollectionStatsHTML({ wholeCollection }); return { content: [ { type: 'text', text: `Collection statistics retrieved (${wholeCollection ? 'whole collection' : 'current deck'})`, }, { type: 'text', text: statsHTML, }, ], }; } catch (error) { throw new Error( `Failed to get collection statistics: ${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