Skip to main content
Glama

add_to_timeline

Add media clips to specific tracks and positions in Adobe Premiere Pro sequences, controlling placement with track index, timecode, and insert mode options.

Instructions

Adds a media clip from the project panel to a sequence timeline at a specific track and time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sequenceIdYesThe ID of the sequence (timeline) to add the clip to
projectItemIdYesThe ID of the project item (clip) to add
trackIndexYesThe index of the video or audio track (0-based)
timeYesThe time in seconds where the clip should be placed on the timeline
insertModeNoWhether to overwrite existing content or insert and shift

Implementation Reference

  • Defines the tool metadata including name, description, and Zod input schema for validating parameters: sequenceId, projectItemId, trackIndex, time, and optional insertMode.
    name: 'add_to_timeline', description: 'Adds a media clip from the project panel to a sequence timeline at a specific track and time.', inputSchema: z.object({ sequenceId: z.string().describe('The ID of the sequence (timeline) to add the clip to'), projectItemId: z.string().describe('The ID of the project item (clip) to add'), trackIndex: z.number().describe('The index of the video or audio track (0-based)'), time: z.number().describe('The time in seconds where the clip should be placed on the timeline'), insertMode: z.enum(['overwrite', 'insert']).optional().describe('Whether to overwrite existing content or insert and shift') }) },
  • Registers the tool handler in the executeTool switch statement, mapping the tool name to the addToTimeline method call.
    case 'add_to_timeline': return await this.addToTimeline(args.sequenceId, args.projectItemId, args.trackIndex, args.time, args.insertMode);
  • Tool handler wrapper in PremiereProTools class that calls the bridge method and formats success/error responses.
    private async addToTimeline(sequenceId: string, projectItemId: string, trackIndex: number, time: number, insertMode = 'overwrite'): Promise<any> { try { const result = await this.bridge.addToTimeline(sequenceId, projectItemId, trackIndex, time); return { success: true, message: `Clip added to timeline successfully`, sequenceId: sequenceId, projectItemId: projectItemId, trackIndex: trackIndex, time: time, insertMode: insertMode, ...result }; } catch (error) { return { success: false, error: `Failed to add clip to timeline: ${error instanceof Error ? error.message : String(error)}`, sequenceId: sequenceId, projectItemId: projectItemId, trackIndex: trackIndex, time: time }; }
  • Core handler in PremiereProBridge that generates and executes ExtendScript to insert the project item as a clip into the specified sequence track at the given time, returning clip details.
    async addToTimeline(sequenceId: string, projectItemId: string, trackIndex: number, time: number): Promise<PremiereProClip> { const script = ` // Add item to timeline var sequence = app.project.getSequenceByID("${sequenceId}"); var projectItem = app.project.getProjectItemByID("${projectItemId}"); var track = sequence.videoTracks[${trackIndex}]; var clip = track.insertClip(projectItem, ${time}); // Return clip info JSON.stringify({ id: clip.clipID, name: clip.name, inPoint: clip.start, outPoint: clip.end, duration: clip.duration, mediaPath: clip.projectItem.getMediaPath() }); `; return await this.executeScript(script); }

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