Skip to main content
Glama

delete_media_file

Remove specific media files from the Anki MCP server by specifying the filename to manage and optimize storage efficiently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesName of the media file to delete

Implementation Reference

  • The handler function executes the tool logic by calling ankiClient.media.deleteMediaFile with the filename parameter, returns a success message in MCP format, or throws an error if it fails.
    async ({ filename }) => { try { await ankiClient.media.deleteMediaFile({ filename }); return { content: [ { type: 'text', text: `Successfully deleted media file: ${filename}`, }, ], }; } catch (error) { throw new Error( `Failed to delete media file: ${error instanceof Error ? error.message : String(error)}` ); } }
  • Zod input schema defining the 'filename' parameter as a required string.
    { filename: z.string().describe('Name of the media file to delete'), },
  • Registration of the 'delete_media_file' tool on the MCP server using server.tool(), including name, schema, and handler.
    server.tool( 'delete_media_file', { filename: z.string().describe('Name of the media file to delete'), }, async ({ filename }) => { try { await ankiClient.media.deleteMediaFile({ filename }); return { content: [ { type: 'text', text: `Successfully deleted media file: ${filename}`, }, ], }; } catch (error) { throw new Error( `Failed to delete media file: ${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