store_media_file
Store an image or media file in Anki's media folder to reference in flashcard fields using HTML img tags. Supports file path, URL, or base64 data.
Instructions
Store an image or media file in Anki's media folder.
Use this tool to store images that can be referenced in flashcard fields using
HTML img tags: <img src="filename">
This is useful when you need to:
- Store an image before creating a note (e.g. to reference it in multiple notes)
- Add an image to an existing card's field
Provide exactly one of url, data, or path:
- path: Absolute path to a local file. PREFERRED when the user shares an image file or screenshot.
- url: A URL to download the image from (e.g. "https://example.com/photo.jpg")
- data: Base64-encoded file content (for small images only)
IMPORTANT: When a user shares an image file or screenshot, prefer using "path" with the absolute
file path. AnkiConnect reads the file directly from disk, which avoids needing to base64-encode
large image files.
Args:
filename: str - The filename to store the media as (e.g. "diagram.png").
url: str - Optional URL to download the image from.
data: str - Optional base64-encoded image data.
path: str - Optional absolute path to a local file. Preferred for user-shared files.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| url | No | ||
| data | No | ||
| path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |