media_deleteMediaFile
Remove specific files from Anki's media folder by specifying the filename, ensuring efficient management and cleanup of multimedia resources.
Instructions
Deletes the specified file from Anki's media folder.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | The name of the file to delete from the media collection. |
Implementation Reference
- src/anki_mcp/media_service.py:81-91 (handler)Handler function for the 'media_deleteMediaFile' tool (prefixed during registration). Deletes the specified media file by calling AnkiConnect API via anki_call. Includes inline schema for 'filename' parameter.@media_mcp.tool( name="deleteMediaFile", description="Deletes the specified file from Anki's media folder.", ) async def delete_media_file_tool( filename: Annotated[ str, Field(description="The name of the file to delete from the media collection."), ], ) -> None: return await anki_call("deleteMediaFile", filename=filename)
- src/anki_mcp/__init__.py:27-27 (registration)Registers all tools from media_mcp (including deleteMediaFile) under the 'media_' namespace/prefix in the main AnkiConnectMCP server.await anki_mcp.import_server("media", media_mcp)