Skip to main content
Glama

media_getMediaFilesNames

Retrieve media file names matching a specific pattern from Anki databases using a glob pattern for organized file management and quick access.

Instructions

Gets the names of media files matching the glob pattern. Returns a list of filenames.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesA glob pattern to match filenames (e.g., '*.jpg').

Implementation Reference

  • Handler function implementing the core logic for 'media_getMediaFilesNames' tool by calling AnkiConnect's getMediaFilesNames API with a glob pattern.
    @media_mcp.tool( name="getMediaFilesNames", description="Gets the names of media files matching the glob pattern. Returns a list of filenames.", ) async def list_media_files_names_tool( pattern: Annotated[ str, Field(description="A glob pattern to match filenames (e.g., '*.jpg').") ], ) -> List[str]: return await anki_call("getMediaFilesNames", pattern=pattern)
  • Registers the media_mcp server (containing the tool) into the main anki_mcp server with 'media' prefix, resulting in tool name 'media_getMediaFilesNames'.
    await anki_mcp.import_server("media", media_mcp)
  • Creates the FastMCP sub-server instance where media tools, including getMediaFilesNames, are registered.
    media_mcp = FastMCP(name="AnkiMediaService")
  • Imports the media_mcp server for registration into the main server.
    from .media_service import media_mcp

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/ujisati/anki-mcp'

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