Skip to main content
Glama

Store media file

store-media-file

Imports bounded media bytes into Anki from base64, a public HTTPS URL, or an allowed local directory while preventing existing files from being overwritten.

Instructions

Safely imports bounded media bytes into Anki from base64, a public HTTPS URL, or an explicitly allowed local directory. Existing files are never overwritten.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "filename": "<filename>",
      "source": "<source>"
    },
    "name": "store-media-file"
  }
}

Input Schema

NameRequiredDescriptionDefault
usageNoStatic template assets must start with an underscore so Anki's media checker preserves themnote-field
sourceYes
filenameYesPortable filename inside Anki's flat collection.media folder
collisionPolicyNorename lets Anki choose a non-conflicting filename; reject makes an existing filename an errorrename

Output Schema

NameRequiredDescriptionDefault
fileYes
storedYes
sourceTypeYes
fieldReferenceYes
storedFilenameYes
collisionRenamedYes
requestedFilenameYes
sourceDescriptionYes
templateReferenceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=true, so the safety profile is largely covered. The description adds real value by making the non-destructive guarantee concrete ('Existing files are never overwritten') and flagging the bounded size and restricted local-path allowlist. It does not explain network-fetch side effects, permission prerequisites, or how the rename behavior interacts with the never-overwrite claim.

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

Conciseness5/5

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

Two tight sentences with zero filler; the safety guarantee is front-loaded alongside the source options so the agent reads the most decision-relevant facts first.

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?

For a mutation tool that fetches remote content and touches the media filesystem, the description covers the essentials: accepted sources, size bounding, and non-overwrite semantics, with annotations and an output schema carrying the rest. Minor gaps remain around permissions and the rename/reject outcome, but nothing blocking.

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

Parameters3/5

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

Schema coverage is 75%, so most parameter meaning is already documented in the schema. The description adds the conceptual link that local paths come from an 'explicitly allowed' directory (ANKI_MEDIA_IMPORT_DIRS) and reinforces the collision behavior, but it never explains the usage enum (note-field vs template-static/underscore naming) or the rename-vs-reject choice.

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

Purpose4/5

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

The description states a specific verb and resource ('imports ... media bytes into Anki') and enumerates the three accepted source modes (base64, public HTTPS URL, allowed local directory). It implicitly contrasts with delete-media-file and get-media-file, though it does not name any sibling explicitly.

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

Usage Guidelines2/5

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

There is no guidance on when to choose this tool over attach-media-to-notes or the other media siblings, and no when-not conditions. The mention of allowed directories is a constraint, not usage routing, so an agent must infer the choice from names alone.

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