Skip to main content
Glama

add_to_timeline

Place a media clip from the project panel into a specific sequence timeline at a defined track, time, and insertion mode using this automation tool for Adobe Premiere Pro.

Instructions

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

Input Schema

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

Implementation Reference

  • The primary handler for the 'add_to_timeline' MCP tool. Validates arguments (via outer executeTool), calls the bridge, 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 }; } }
  • Input schema and metadata definition for the add_to_timeline tool, used for validation and MCP tool discovery.
    { 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') }) },
  • Switch case in executeTool() that registers and routes calls to the add_to_timeline handler.
    case 'add_to_timeline': return await this.addToTimeline(args.sequenceId, args.projectItemId, args.trackIndex, args.time, args.insertMode); case 'remove_from_timeline':
  • Supporting bridge method invoked by the tool handler. Executes ExtendScript in Premiere Pro to insert the project item as a clip on the specified track at the given time.
    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); }
  • src/index.ts:74-81 (registration)
    MCP server registration: ListTools handler that exposes add_to_timeline (via PremiereProTools.getAvailableTools()) to MCP clients.
    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 }; });

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