get_version
Retrieve the current version of the Anki MCP server to ensure compatibility and verify system updates.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/miscellaneous.ts:391-407 (registration)Registers the 'get_version' tool with an empty schema and provides an inline handler that retrieves the AnkiConnect version via ankiClient and formats it as a text response.server.tool('get_version', {}, async () => { try { const version = await ankiClient.miscellaneous.version(); return { content: [ { type: 'text', text: `AnkiConnect version: ${version}`, }, ], }; } catch (error) { throw new Error( `Failed to get version: ${error instanceof Error ? error.message : String(error)}` ); } });
- src/tools/miscellaneous.ts:392-407 (handler)The handler function for the 'get_version' tool, which calls ankiClient.miscellaneous.version() to get the version and returns it in the expected MCP format, with error handling.try { const version = await ankiClient.miscellaneous.version(); return { content: [ { type: 'text', text: `AnkiConnect version: ${version}`, }, ], }; } catch (error) { throw new Error( `Failed to get version: ${error instanceof Error ? error.message : String(error)}` ); } });