Skip to main content
Glama

export_package

Export Anki flashcards from a specified deck to a file, including optional scheduling information, for backup or sharing purposes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deckNameYesName of the deck to export
filePathYesPath where to save the exported package
includeSchedNoWhether to include scheduling information

Implementation Reference

  • Registers the 'export_package' MCP tool, including schema and handler function.
    server.tool( 'export_package', { deckName: z.string().describe('Name of the deck to export'), filePath: z.string().describe('Path where to save the exported package'), includeSched: z.boolean().optional().describe('Whether to include scheduling information'), }, async ({ deckName, filePath, includeSched }) => { try { const params: any = { deck: deckName, path: filePath }; if (includeSched !== undefined) params.includeSched = includeSched; const result = await ankiClient.miscellaneous.exportPackage(params); return { content: [ { type: 'text', text: `Successfully exported deck "${deckName}" to ${filePath}. Result: ${result}`, }, ], }; } catch (error) { throw new Error( `Failed to export package: ${error instanceof Error ? error.message : String(error)}` ); } } );
  • The handler function for the 'export_package' tool. Prepares parameters and calls the underlying ankiClient.exportPackage method, returning a success message or throwing an error.
    async ({ deckName, filePath, includeSched }) => { try { const params: any = { deck: deckName, path: filePath }; if (includeSched !== undefined) params.includeSched = includeSched; const result = await ankiClient.miscellaneous.exportPackage(params); return { content: [ { type: 'text', text: `Successfully exported deck "${deckName}" to ${filePath}. Result: ${result}`, }, ], }; } catch (error) { throw new Error( `Failed to export package: ${error instanceof Error ? error.message : String(error)}` ); } }
  • Zod schema defining input parameters for the 'export_package' tool: deckName (required), filePath (required), includeSched (optional boolean).
    { deckName: z.string().describe('Name of the deck to export'), filePath: z.string().describe('Path where to save the exported package'), includeSched: z.boolean().optional().describe('Whether to include scheduling information'), },
  • The 'anki_operations' consolidated tool uses the same underlying exportPackage functionality in its 'export_deck' operation.
    case 'export_deck': { if (!deckName || !filePath) { throw new Error('export_deck requires deckName and filePath'); } const params: any = { deck: deckName, path: filePath }; if (includeSched !== undefined) params.includeSched = includeSched; await ankiClient.miscellaneous.exportPackage(params); return { content: [ { type: 'text', text: `✓ Exported deck "${deckName}" to ${filePath}`, }, ], }; }

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