Skip to main content
Glama

Get media file contents

get_media_file
Read-onlyIdempotent

Reads one file from Anki's media folder and returns it as base64, including viewable image content, so you can inspect a card-referenced image or audio file by bare filename.

Instructions

Read one file from Anki's media folder and return it as base64; images are also returned as image content the model can look at. Read-only. Use this when you need a referenced image/audio file's actual contents; use manage_collection list_media to find file names and store_media/delete_media to change files. Pass the bare filename as it appears in the card (e.g. "diagram.png"); paths and ".." are rejected. Returns an error object if the file doesn't exist.

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>"
    },
    "name": "get_media_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYesBare media file name as referenced in a card, e.g. "image.png" (no paths)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.7.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / filename / description
      Previous value: -"Media filename referenced in Anki cards (e.g., \"image.png\")"New value: +"Bare media file name as referenced in a card, e.g. \"image.png\" (no paths)"
  2. Addedv1.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description still adds real behavior: base64 return, image content blocks the model can view, rejection of paths and '..', and an error object when the file is missing. That is disclosure beyond the structured data, not a restatement of it.

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?

Four compact sentences, each carrying distinct information, with purpose and return shape front-loaded and routing/validation following. No filler.

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

Completeness5/5

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

For a single-parameter read tool with no output schema, the description covers input format, validation behavior, return encoding, and failure mode. An agent has everything needed to call it correctly and interpret the result.

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

Parameters4/5

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

Schema coverage is 100% and already documents the bare-filename expectation, but the description reinforces it with a concrete example and adds the constraint that paths and '..' are rejected, which the schema does not state.

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 gives a specific verb and resource ('Read one file from Anki's media folder'), states the return encoding (base64) and the special-case rendering for images. It is clearly distinguishable from sibling collection-management tools.

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

Usage Guidelines5/5

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

It states exactly when to reach for it ('when you need a referenced image/audio file's actual contents') and routes the agent to named alternatives for adjacent jobs: list_media for discovering names, store_media/delete_media for mutations.

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