Skip to main content
Glama

get_media_files_names

Extract and list media file names matching a specific pattern from the Anki MCP server. Specify the pattern (e.g., "*.jpg") to retrieve desired files efficiently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesPattern to match media file names (e.g., "*.jpg", "*audio*")

Implementation Reference

  • MCP tool registration and handler for 'get_media_files_names'. Defines input schema (pattern: string), executes by calling ankiClient.media.getMediaFilesNames(pattern), and returns formatted list of matching media files or throws error.
    server.tool( 'get_media_files_names', { pattern: z.string().describe('Pattern to match media file names (e.g., "*.jpg", "*audio*")'), }, async ({ pattern }) => { try { const filenames = await ankiClient.media.getMediaFilesNames({ pattern }); return { content: [ { type: 'text', text: `Media files matching pattern "${pattern}": ${JSON.stringify(filenames, null, 2)}`, }, ], }; } catch (error) { throw new Error( `Failed to get media file names: ${error instanceof Error ? error.message : String(error)}` ); } } );
  • Zod input schema for the get_media_files_names tool: requires a 'pattern' string parameter.
    { pattern: z.string().describe('Pattern to match media file names (e.g., "*.jpg", "*audio*")'), },
  • src/tools/media.ts:8-8 (registration)
    Function that registers all media tools including get_media_files_names on the MCP server (though not called in main server setup).
    export function registerMediaTools(server: McpServer) {
  • Lists 'getMediaFilesNames' as a supported AnkiConnect action in the 'multi' tool's action enum.
    'getMediaFilesNames',
  • Usage of the underlying ankiClient.media.getMediaFilesNames in the 'anki_operations' tool's 'list_media' case.
    const files = await ankiClient.media.getMediaFilesNames({ pattern });

Other Tools

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

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