Skip to main content
Glama

trim_clip

Modify the start and end points of a clip in Adobe Premiere Pro to adjust its length directly through automation, using clip ID and precise timing inputs.

Instructions

Adjusts the in and out points of a clip on the timeline, effectively shortening it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clipIdYesThe ID of the clip on the timeline to trim
durationNoAlternative: set the desired duration in seconds
inPointNoThe new in point in seconds from the start of the clip
outPointNoThe new out point in seconds from the start of the clip

Implementation Reference

  • The handler function for trim_clip. It constructs and executes an ExtendScript that finds the clip by ID and adjusts its inPoint, outPoint, or sets a new duration by modifying outPoint accordingly. Returns old and new points for verification.
    private async trimClip(clipId: string, inPoint?: number, outPoint?: number, 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 oldInPoint = clip.inPoint.seconds; var oldOutPoint = clip.outPoint.seconds; var oldDuration = clip.duration.seconds; ${inPoint !== undefined ? `clip.inPoint = new Time("${inPoint}s");` : ''} ${outPoint !== undefined ? `clip.outPoint = new Time("${outPoint}s");` : ''} ${duration !== undefined ? `clip.outPoint = new Time(clip.inPoint.seconds + ${duration});` : ''} JSON.stringify({ success: true, message: "Clip trimmed successfully", clipId: "${clipId}", oldInPoint: oldInPoint, oldOutPoint: oldOutPoint, oldDuration: oldDuration, newInPoint: clip.inPoint.seconds, newOutPoint: clip.outPoint.seconds, newDuration: clip.duration.seconds }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script); }
  • Input schema validation using Zod for the trim_clip tool parameters.
    name: 'trim_clip', description: 'Adjusts the in and out points of a clip on the timeline, effectively shortening it.', inputSchema: z.object({ clipId: z.string().describe('The ID of the clip on the timeline to trim'), inPoint: z.number().optional().describe('The new in point in seconds from the start of the clip'), outPoint: z.number().optional().describe('The new out point in seconds from the start of the clip'), duration: z.number().optional().describe('Alternative: set the desired duration in seconds') })
  • Dispatches to the trimClip handler method in the executeTool switch statement.
    case 'trim_clip': return await this.trimClip(args.clipId, args.inPoint, args.outPoint, args.duration);

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