add_transition
Add transitions between video clips in Adobe Premiere Pro to create smooth scene changes and professional edits.
Instructions
Adds a transition (e.g., cross dissolve) between two adjacent clips on the timeline.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clipId1 | Yes | The ID of the first clip (outgoing) | |
| clipId2 | Yes | The ID of the second clip (incoming) | |
| transitionName | Yes | The name of the transition to add (e.g., "Cross Dissolve") | |
| duration | Yes | The duration of the transition in seconds |
Implementation Reference
- src/tools/index.ts:208-217 (registration)Registers the 'add_transition' tool in getAvailableTools() with name, description, and Zod input schema for MCP compatibility.{ name: 'add_transition', description: 'Adds a transition (e.g., cross dissolve) between two adjacent clips on the timeline.', inputSchema: z.object({ clipId1: z.string().describe('The ID of the first clip (outgoing)'), clipId2: z.string().describe('The ID of the second clip (incoming)'), transitionName: z.string().describe('The name of the transition to add (e.g., "Cross Dissolve")'), duration: z.number().describe('The duration of the transition in seconds') }) },
- src/tools/index.ts:478-479 (handler)Dispatches 'add_transition' tool calls to the private addTransition handler method in executeTool switch statement.case 'add_transition': return await this.addTransition(args.clipId1, args.clipId2, args.transitionName, args.duration);
- src/tools/index.ts:1282-1325 (handler)Core implementation of the 'add_transition' tool: constructs ExtendScript to retrieve clips by ID, add transition between them on their track, and returns success/error via PremiereProBridge.private async addTransition(clipId1: string, clipId2: string, transitionName: string, duration: number): Promise<any> { const script = ` try { var clip1 = app.project.getClipByID("${clipId1}"); var clip2 = app.project.getClipByID("${clipId2}"); if (!clip1 || !clip2) { JSON.stringify({ success: false, error: "One or both clips not found" }); return; } var track = clip1.getTrack(); var transition = track.addTransition("${transitionName}", clip1, clip2, ${duration}); if (!transition) { JSON.stringify({ success: false, error: "Failed to add transition" }); return; } JSON.stringify({ success: true, message: "Transition added successfully", transitionName: "${transitionName}", duration: ${duration}, clip1Id: "${clipId1}", clip2Id: "${clipId2}", transitionId: transition.nodeId }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script); }
- src/tools/index.ts:211-216 (schema)Zod schema defining input parameters for the 'add_transition' tool: clip IDs, transition name, and duration.inputSchema: z.object({ clipId1: z.string().describe('The ID of the first clip (outgoing)'), clipId2: z.string().describe('The ID of the second clip (incoming)'), transitionName: z.string().describe('The name of the transition to add (e.g., "Cross Dissolve")'), duration: z.number().describe('The duration of the transition in seconds') })
- src/index.ts:74-81 (registration)MCP server handler for listing tools, which exposes the 'add_transition' tool from PremiereProTools to the MCP protocol.this.server.setRequestHandler(ListToolsRequestSchema, async () => { const tools = this.tools.getAvailableTools().map((tool) => ({ name: tool.name, description: tool.description, inputSchema: zodToJsonSchema(tool.inputSchema, { $refStrategy: 'none' }) })); return { tools }; });