Skip to main content
Glama

clone_deck_config

Duplicate an Anki deck configuration by specifying its ID and assigning a new name, enabling quick replication of settings for streamlined deck management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newConfigNameYesName for the new cloned configuration
sourceConfigIdYesID of the deck configuration to clone from

Implementation Reference

  • Handler function that clones the deck configuration by calling ankiClient.deck.cloneDeckConfigId with sourceConfigId and newConfigName, handles success and error cases, and returns structured content.
    async ({ sourceConfigId, newConfigName }) => { try { const result = await ankiClient.deck.cloneDeckConfigId({ cloneFrom: sourceConfigId, name: newConfigName, }); if (result === false) { throw new Error('Failed to clone deck configuration - operation returned false'); } return { content: [ { type: 'text', text: `Successfully cloned deck configuration. New config ID: ${result}`, }, ], }; } catch (error) { throw new Error( `Failed to clone deck configuration: ${error instanceof Error ? error.message : String(error)}` ); } } );
  • Zod schema for input parameters: sourceConfigId (number) and newConfigName (string).
    { sourceConfigId: z.number().describe('ID of the deck configuration to clone from'), newConfigName: z.string().describe('Name for the new cloned configuration'), },
  • MCP tool registration using server.tool, including name 'clone_deck_config', input schema, and inline handler implementation.
    server.tool( 'clone_deck_config', { sourceConfigId: z.number().describe('ID of the deck configuration to clone from'), newConfigName: z.string().describe('Name for the new cloned configuration'), }, async ({ sourceConfigId, newConfigName }) => { try { const result = await ankiClient.deck.cloneDeckConfigId({ cloneFrom: sourceConfigId, name: newConfigName, }); if (result === false) { throw new Error('Failed to clone deck configuration - operation returned false'); } return { content: [ { type: 'text', text: `Successfully cloned deck configuration. New config ID: ${result}`, }, ], }; } catch (error) { throw new Error( `Failed to clone deck configuration: ${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