Skip to main content
Glama

trim_clip

Adjust in and out points to shorten video clips on the timeline. Use this tool to precisely control clip duration by setting new start and end times.

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
inPointNoThe new in point in seconds from the start of the clip
outPointNoThe new out point in seconds from the start of the clip
durationNoAlternative: set the desired duration in seconds

Implementation Reference

  • The core handler function for the 'trim_clip' tool. It constructs and executes an ExtendScript via the PremiereProBridge to locate the clip by ID and adjust its inPoint, outPoint, or set a new duration by modifying the outPoint accordingly. Returns detailed before/after timing information.
    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); }
  • The tool definition including name, description, and Zod input schema validation for 'trim_clip'. This is returned by getAvailableTools() for MCP tool discovery.
    { 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') }) },
  • The dispatch/registration of the 'trim_clip' tool within the central executeTool switch statement, mapping the tool name to the trimClip handler invocation.
    return await this.trimClip(args.clipId, args.inPoint, args.outPoint, args.duration); case 'split_clip':

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