add_transition_to_clip
Apply a video transition to the start or end of a clip in Adobe Premiere Pro. Specify clip ID, transition type, position, and duration to enhance editing workflow.
Instructions
Adds a transition to the beginning or end of a single clip.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clipId | Yes | The ID of the clip | |
| transitionName | Yes | The name of the transition | |
| position | Yes | Whether to add the transition at the start or end of the clip | |
| duration | Yes | The duration of the transition in seconds |
Implementation Reference
- src/tools/index.ts:1327-1373 (handler)Executes the tool by generating and running an ExtendScript in Premiere Pro to add a transition to the specified position (start or end) of a clip on the timeline.private async addTransitionToClip(clipId: string, transitionName: string, position: 'start' | 'end', duration: number): Promise<any> { const script = ` try { var clip = app.project.getClipByID("${clipId}"); if (!clip) { JSON.stringify({ success: false, error: "Clip not found" }); return; } var track = clip.getTrack(); var transition; if ("${position}" === "start") { transition = track.addTransition("${transitionName}", clip, "start", ${duration}); } else { transition = track.addTransition("${transitionName}", clip, "end", ${duration}); } if (!transition) { JSON.stringify({ success: false, error: "Failed to add transition" }); return; } JSON.stringify({ success: true, message: "Transition added successfully", transitionName: "${transitionName}", position: "${position}", duration: ${duration}, clipId: "${clipId}", transitionId: transition.nodeId }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script);
- src/tools/index.ts:219-227 (schema)Zod schema defining the input parameters for the 'add_transition_to_clip' tool.name: 'add_transition_to_clip', description: 'Adds a transition to the beginning or end of a single clip.', inputSchema: z.object({ clipId: z.string().describe('The ID of the clip'), transitionName: z.string().describe('The name of the transition'), position: z.enum(['start', 'end']).describe('Whether to add the transition at the start or end of the clip'), duration: z.number().describe('The duration of the transition in seconds') }) },
- src/tools/index.ts:480-481 (registration)Tool dispatch in the executeTool method's switch statement, mapping the tool name to its handler function.case 'add_transition_to_clip': return await this.addTransitionToClip(args.clipId, args.transitionName, args.position, args.duration);