trim_clip_by_frames
Adjust in/out points of video or audio clips in Premiere Pro by a specified number of frames, enabling precise editing control for sequences.
Instructions
Trim or extend the in/out point of a video or audio clip by a number of frames.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clipId | Yes | ID of the clip to trim | |
| direction | Yes | Which edit point to trim ('in' or 'out') | |
| framesDelta | Yes | Number of frames to trim (positive or negative) | |
| sequenceId | Yes | Index of the sequence (0-based) | |
| trackType | Yes | Track type ('video' or 'audio') |
Implementation Reference
- mcp-server.js:146-160 (registration)Tool registration in listTools handler, including name, description, and input schema definition.{ name: "trim_clip_by_frames", description: "Trim or extend the in/out point of a video or audio clip by a number of frames.", inputSchema: { type: "object", properties: { sequenceId: { type: "number", description: "Index of the sequence (0-based)" }, clipId: { type: "string", description: "ID of the clip to trim" }, framesDelta: { type: "number", description: "Number of frames to trim (positive or negative)" }, direction: { type: "string", enum: ["in", "out"], description: "Which edit point to trim ('in' or 'out')" }, trackType: { type: "string", enum: ["video", "audio"], description: "Track type ('video' or 'audio')" } }, required: ["sequenceId", "clipId", "framesDelta", "direction", "trackType"] } },
- mcp-server.js:264-285 (handler)Main execution handler for the tool in the CallToolRequest switch statement. Extracts parameters and delegates to ExtendScript via runExtendScriptFile.case 'trim_clip_by_frames': { // Dynamically import and call the ExtendScript function const { sequenceId, clipId, framesDelta, direction, trackType } = args; // Here you would use your existing bridge to call the ExtendScript file // For demonstration, we'll assume a function runExtendScriptFile exists const { runExtendScriptFile } = require('./runExtendScriptFile'); const result = await runExtendScriptFile('trimClipByFrames.jsx', 'trimClipByFrames', [sequenceId, clipId, framesDelta, direction, trackType]); if (result && result.success) { return { content: [ { type: 'text', text: `✅ Clip trimmed successfully.` } ] }; } else { return { content: [ { type: 'text', text: `❌ Failed to trim clip: ${result && result.error ? result.error : 'Unknown error'}` } ], isError: true }; } }
- runExtendScriptFile.js:14-20 (helper)Helper function used by the handler to execute the actual trimClipByFrames.jsx ExtendScript file containing Premiere Pro automation logic.async function runExtendScriptFile(scriptFile, functionName, args) { // TODO: Integrate with your CEP/host communication bridge // For now, just log the call and return a fake success console.log(`[Stub] Would call ExtendScript: ${scriptFile} -> ${functionName}(${args.join(', ')})`); // Simulate async call return { success: true }; }
- panel-bridge.js:11-11 (helper)CEP panel bridge loads the trimClipByFrames.jsx ExtendScript file into the Premiere Pro environment.csInterface.evalScript('$.evalFile("trimClipByFrames.jsx")');