import_media
Add video, audio, or image files to your Premiere Pro project by specifying file paths and organizing them into bins for efficient editing workflows.
Instructions
Imports a media file (video, audio, image) into the current Premiere Pro project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | The absolute path to the media file to import | |
| binName | No | The name of the bin to import the media into. If not provided, it will be imported into the root. |
Implementation Reference
- src/tools/index.ts:87-94 (registration)Registration of the 'import_media' MCP tool in getAvailableTools(), defining name, description, and Zod input schema{ name: 'import_media', description: 'Imports a media file (video, audio, image) into the current Premiere Pro project.', inputSchema: z.object({ filePath: z.string().describe('The absolute path to the media file to import'), binName: z.string().optional().describe('The name of the bin to import the media into. If not provided, it will be imported into the root.') }) },
- src/tools/index.ts:90-93 (schema)Input schema (Zod) for the import_media toolinputSchema: z.object({ filePath: z.string().describe('The absolute path to the media file to import'), binName: z.string().optional().describe('The name of the bin to import the media into. If not provided, it will be imported into the root.') })
- src/tools/index.ts:817-834 (handler)Primary handler for import_media tool: calls bridge.importMedia and formats response with success/error handlingprivate async importMedia(filePath: string, binName?: string): Promise<any> { try { const result = await this.bridge.importMedia(filePath); return { success: true, message: `Media imported successfully`, filePath: filePath, binName: binName || 'Root', ...result }; } catch (error) { return { success: false, error: `Failed to import media: ${error instanceof Error ? error.message : String(error)}`, filePath: filePath }; } }
- src/tools/index.ts:446-448 (handler)Dispatch case in executeTool that routes import_media calls to the handler methodcase 'import_media': return await this.importMedia(args.filePath, args.binName); case 'import_folder':
- src/bridge/index.ts:229-247 (handler)Core bridge handler: executes ExtendScript via executeScript to import media file into Premiere Pro project and return item detailsasync importMedia(filePath: string): Promise<PremiereProProjectItem> { const script = ` // Import media file var file = new File("${filePath}"); var importedItem = app.project.importFiles([file.fsName]); // Return imported item info JSON.stringify({ id: importedItem.nodeId, name: importedItem.name, type: importedItem.type, mediaPath: importedItem.getMediaPath(), duration: importedItem.getOutPoint() - importedItem.getInPoint(), frameRate: importedItem.getVideoFrameRate() }); `; return await this.executeScript(script); }