Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes
urlNo
dataNo
pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description explains the tool reads from disk, downloads from URL, or decodes base64. It specifies exactly one of url/data/path must be provided. It doesn't detail error handling but covers core behavior well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with bullet points and clear sections, though slightly verbose. It front-loads purpose and usage, then dives into parameter details. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 4 parameters (1 required) and an output schema, the description covers usage scenarios and parameter selection adequately. Return value is not explained but output schema exists. The description is complete for typical use cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description adds crucial meaning: explains each parameter's role, preferred use cases (path for user files, data for small images), and the constraint of providing exactly one. This fully compensates for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool stores an image or media file in Anki's media folder for use in flashcards via HTML img tags. It distinguishes itself from sibling tools like add_note or update_note_fields by focusing on media storage.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides when to use the tool (before creating a note, adding to existing cards) and detailed guidance on which parameter to use (path preferred for user-shared files, data for small images). It does not explicitly state when not to use it but gives clear context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/samefarrar/mcp-ankiconnect'

If you have feedback or need assistance with the MCP directory API, please join our Discord server