Skip to main content
Glama

import_folder

Import media files from a specified folder into the current Adobe Premiere Pro project, optionally organizing them into a named bin and including subfolders recursively.

Instructions

Imports all media files from a folder into the current Premiere Pro project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
binNameNoThe name of the bin to import the media into
folderPathYesThe absolute path to the folder containing media files
recursiveNoWhether to import from subfolders recursively

Implementation Reference

  • The handler function for the 'import_folder' tool. It constructs and executes an ExtendScript via the bridge to import media files from the specified folder into the Premiere Pro project, supporting recursive import and targeting a specific bin.
    private async importFolder(folderPath: string, binName?: string, recursive = false): Promise<any> { const script = ` try { var folder = new Folder("${folderPath}"); var importedItems = []; var errors = []; function importFiles(dir, targetBin) { var files = dir.getFiles(); for (var i = 0; i < files.length; i++) { var file = files[i]; if (file instanceof File) { try { var item = targetBin.importFiles([file.fsName]); if (item && item.length > 0) { importedItems.push({ name: file.name, path: file.fsName, id: item[0].nodeId }); } } catch (e) { errors.push({ file: file.name, error: e.toString() }); } } else if (file instanceof Folder && ${recursive}) { importFiles(file, targetBin); } } } var targetBin = app.project.rootItem; ${binName ? `targetBin = app.project.rootItem.children["${binName}"] || app.project.rootItem;` : ''} importFiles(folder, targetBin); JSON.stringify({ success: true, importedItems: importedItems, errors: errors, totalImported: importedItems.length, totalErrors: errors.length }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script); }
  • Zod input schema defining parameters for the import_folder tool: folderPath (required), binName (optional), recursive (optional).
    inputSchema: z.object({ folderPath: z.string().describe('The absolute path to the folder containing media files'), binName: z.string().optional().describe('The name of the bin to import the media into'), recursive: z.boolean().optional().describe('Whether to import from subfolders recursively') })
  • Registration and dispatch of the import_folder tool within the executeTool switch statement, mapping the tool name to its handler.
    case 'import_folder': return await this.importFolder(args.folderPath, args.binName, args.recursive);
  • Tool registration in the getAvailableTools() method, defining name, description, and schema.
    name: 'import_folder', description: 'Imports all media files from a folder into the current Premiere Pro project.', inputSchema: z.object({ folderPath: z.string().describe('The absolute path to the folder containing media files'), binName: z.string().optional().describe('The name of the bin to import the media into'), recursive: z.boolean().optional().describe('Whether to import from subfolders recursively') }) },

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/hetpatel-11/Adobe_Premiere_Pro_MCP'

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